1595120340
INTRODUCTION
I thought this week I’d write just 8 bits about basic Git usage, just to take a byte out of the subject 😉. Over the next few weeks, I plan to go into more advanced topics. I hope my ambition doesn’t come back to byte me in the bithind 😬.
The ability to ‘undo’ and ‘redo’ changes is so common in my digital life I almost take it for granted. Nearly every editor (text, video, graphic, music, code) has multiple layers of undo, redo, cut and paste. Think of it like a massive Mead Trapper Keeper that holds all of your changes, and from which you can pull pages out, archive them, and restore them at a later time. You can also Ditto them and branch off and create something new, and wildly different starting from the same starting point, but in a different repository.
2. What is a repository?
I don’t want to go off-course and fall into too many rabbit-holes, but I think the pictures on this page can explain it well!
3. What is Git and Github?
Git is a brand name of a Version Control System (VCS), there are many others, and the history of Git is interesting. It was developed by the same man who developed Linux, Linux Torvalds. Its, by far, the most popular by number of repositories.
#programmer-jokes #git-beginner #git-humor #dadjokes
1593583680
Git is one of the most popular tools used as a distributed version control system (VCS). Git is commonly used for source code management (SCM) and has become more used than old VCS systems like SVN. In this article, we’ll show you how to install Git on your Ubuntu 16.04 dedicated server.
We have also created a convenient video tutorial that outlines how to install Git on a Ubuntu 16.04 Server.
Now, let’s get started on that install…
First, as always, we should start out by running general OS and package updates. On Ubuntu we’ll do this by running:
apt-get update
After you have run the general updates on the server you can get started with installing Git.
Install Git
apt-get install git-core
You may be asked to confirm the download and installation; simply enter y to confirm. It’s that simple, Git should be installed and ready to use!
Confirm Git the installation
With the main installation done, first check to ensure the executable file is set up and accessible. The best way to do this is simply to run Git with the version command.
git --version
git version 2.7.4
Configure Git’s settings (for the root user)
It’s a good idea to setup your user for git now, to prevent any commit errors later. We’ll setup the user testuser with the e-mail address testuser@example.com.
git config --global user.name "testuser" git config --global user.email "testuser@example.com"
Note:
It’s important to know that git configs work on a user by user basis. For example, if you have a ‘david’ Linux user and they will be working with git then David should run the same commands from his user account. By doing this the commits made by the ‘david’ Linux user will be done under his details in Git.
#distributed version control #git #linux #scm #source code management #tools #ubuntu #ubuntu 16.04 #vcs #version control #version control system
1594895556
The greatest challenge, and most interesting thing about software development is the amount of knowledge there is. With every new skill I try and develop I find vast network of new knowledge pathways that I suddenly find myself wanting to pursue.
When I started learning to program, I learned about version control systems. It made a lot of sense and learning enough to get started was not too difficult at all. But, after a short while, I learned that what I knew was akin to saying you’re a New Yorker, when really you’ve only commuted back and forth to work, ate at all the ‘famous’ places listed in TimeOut or in movies, and rented an overpriced “luxury” no-fee apartment whose rent will price you out in 2 years, forcing you to do the search all over again, or perhaps, you’ve jumped into that empty subway car during rush hour, only to realize after the doors close, that you’ve made a terrible mistake! 🤢
The first thing I learned about Git, Github and version control, was copying a repo link and using ‘git clone’ to make a copy on my local machine. After making edits, I would ‘git add .’ and then ‘git push’. That was literally it. Not much.
It helped a lot to not be overwhelmed with having to learn everything about Git at once, because there were so many other things I had to also learn-Ruby, Sinatra, database schema and SQL commands, basic logic and syntax, then Javascript, React and a bit of Redux. If I also had to learn Git front to back, and logically, everything else top to bottom, it would have been too much for a person like me.
#vcs #git #git version contro
1604109000
Git has become ubiquitous as the preferred version control system (VCS) used by developers. Using Git adds immense value especially for engineering teams where several developers work together since it becomes critical to have a system of integrating everyone’s code reliably.
But with every powerful tool, especially one that involves collaboration with others, it is better to establish conventions to follow lest we shoot ourselves in the foot.
At DeepSource, we’ve put together some guiding principles for our own team that make working with a VCS like Git easier. Here are 5 simple rules you can follow:
Oftentimes programmers working on something get sidetracked into doing too many things when working on one particular thing — like when you are trying to fix one particular bug and you spot another one, and you can’t resist the urge to fix that as well. And another one. Soon, it snowballs and you end up with so many changes all going together in one commit.
This is problematic, and it is better to keep commits as small and focused as possible for many reasons, including:
Additionally, it helps you mentally parse changes you’ve made using git log
.
#open source #git #git basics #git tools #git best practices #git tutorials #git commit
1597916460
There is no doubt that Git plays a significant role in software development. It allows developers to work on the same code base at the same time. Still, developers struggle for code quality. Why? They fail to follow git best practices. In this post, I will explain seven core best practices of Git and a Bonus Section.
Committing something to Git means that you have changed your code and want to save these changes as a new trusted version.
Version control systems will not limit you in how you commit your code.
But is it good? Not quite.
Because you are compromising code quality, and it will take more time to review code. So overall, team productivity will be reduced. The best practice is to make an atomic commit.
When you do an atomic commit, you’re committing only one change. It might be across multiple files, but it’s one single change.
Many developers make some changes, then commit, then push. And I have seen many repositories with unwanted files like dll, pdf, etc.
You can ask two questions to yourself, before check-in your code into the repository
You can simply use the .gitignore file to avoid unwanted files in the repository. If you are working on more then one repo, it’s easy to use a global .gitignore file (without adding or pushing). And .gitignore file adds clarity and helps you to keep your code clean. What you can commit, and it will automatically ignore the unwanted files like autogenerated files like .dll and .class, etc.
#git basics #git command #git ignore #git best practices #git tutorial for beginners #git tutorials
1617428820
GIT is great, it has made collaboration with other developers so easy, I can’t thank GIT enough. But GIT is vast and not every command remains on my mind. I find myself googling over and over again to get that right GIT command that can solve my problem.
Recently when working on one of the projects that had just started, I accidentally pushed the IDE folder to the remote repository and I was there googling again, so I thought, why not write a blog for this? I can always come straight to my blog if this happens again and I can also help my fellow developers this way, right?
All sensitive information and IDE related folders should be added to gitignore so they are not tracked by git. You may already know this, but it doesn’t help if your file or folder is already in the remote repository. Today we will learn how we can remove files or folders from remote repositories. Let’s get started!
#git #github #gitlab #git-tags #git-basics #tutorial #guide #version-control