Two Git Files To Make Your Life A Little Easier

March 23, 2013

Whenever you create a new git repository with git init, create these files too. It only takes a few seconds and makes your life much easier later on.

Git Ignores
Ignore files tell git which files you do not want to be bothered with in your repository. Each project may have its own specific files that you want to ignore, but this is a good list to start with as it covers all the hidden OS files that git likes to keep telling you have changed. In the root directory of your repository, create a file called .gitignore and put this in it.


You will then need to commit this file before it will start working.

Git Config
If you like to use the terminal to do all your git commands, you can change your config to colour code the output from git. This makes it easier to see the different between new, modified and deleted files. From the root of your repository, edit the file .git/config and append the following:

[color] ui = auto

That’s it! There have been times where I have thought to myself that I won’t bother doing this as it’s only a temporary repository. Quite often, about four commits later I am adding these in as I am already missing the benefits!

No comments

You must be logged in to post a comment.