Git Ignore Untracked Files

Config

git-logo

If you do not want to see Git messages about build directories or miscellaneous scratch files then add them to your .gitignore file. To do so, create the file, add the directories/files and then add the file to git.

E.g.

touch .gitignore

Edit the file to suit your needs and then add/commit.

git add .gitignore
git commit .gitignore
3 Comments

3 Comments

  1. Daniel Dillon  •  Jun 22, 2010 @16:23

    Newbie question… What folder do you run these commands in?

  2. Ryan  •  Aug 18, 2010 @10:30

    Hey… run them from the base of your local git repository.

  3. Jan  •  Oct 22, 2010 @11:52

    You can also put the name of the folder to be ignored into the ‘exclude’ file in ‘.git/info’.

    That way, you have all your ignores in one central place and don’t have to commit that change.

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>