Git is a free, open source version control system. If you’re looking to learn to use Git, you might find the tutorial at Github extremely useful. Google “github git tutorial” for a horde of beautiful learning resources. You can also go to bitbucket, sign up for a free account and practice using a git tutorial. In this post, I point out various tips/tricks I used to make Git behave the way I want. This is nothing new, you can find this information all over the web. I just felt like I should list all these in one place.
####Colored output from Git
This is simple. Run this command in a terminal:
git config --global color.ui auto
This command will add the following snippet to your
ui = auto
Or, you can manually add the above snippet to your
####Setting up different user names and emails for different repositories
Git sets up your global (system wide) user name/email in
You can do this via this command.
git config --global user.email firstname.lastname@example.org git config --global user.name myusername
This will add the following code snippet to your
[user] email = email@example.com name = myusername
But if you maintain different user names/emails for different repositories, then you need to set up the user name/email for every repository independently. You can do this by typing this command inside the repository.
git config user.email firstname.lastname@example.org git config user.name myusername
The default option for
git config is
--local so you don’t need to
The above commands will add the same snippet as before, but this time to
This post is the part of the Using Git series: