Home > GIT > GIT – Ignoring files

GIT – Ignoring files

there are 2 ways to ignore files in git – these files will not be tracked. If you use an IDE, it will create some settings of its own inside your git directory. If they are not ignored, then they will be pushed to your remote server and will be pulled when someone pulls from your repo.

Ignoring Files withe  a global config file

Just create a global config file and place it anywhere you like ( recommended is to put it in your home directory )

I am going to create it in this dir – /home/Desktop/naveen/GIT

cd /home/Desktop/naveen/GIT
touch .gitignore_global

put all the rules you want in here to ignore files

i typically ignore all hidden files with these 2 lines in the file


To see how rules work and samples refer to these links

Next we need to add it to gits global config using this command

please give the full path name to the global ignore file

git config --global core.excludesfile  /home/Desktop/naveen/GIT/.gitignore_global

Ignoring Files from every Repo  

if you want to exclude different files per Repo, then all you need to do is create a file called .gitignore and put it in whatever path you want inside your Repo


Categories: GIT
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: