Ignore file types being tracked in GIT

I use SmartGIT for source control. I link the GIT repository directly to my source repository locally. As a result, the compiled source files also get tracked within GIT. e.g. the python compiled files (.pyc) also add up in the GIT tracker. In order to ignore file types being tracked within GIT, navigate to the local source repository linked to GIT. There must be a hidden directory named .git. Navigate to .git/info/ and look for a file called exclude (without any extensions). If the file doesn’t exist, create one. Add the file types that you would like GIT to ignore tracking. e.g. here’s the content of the file where I would like to exclude .pyc files from tracking

# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
*.pyc
*.project
*.pydevproject
Advertisements
Posted in GIT

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