Thursday, October 3, 2013

How to Exclude Folders From Git Gui on Windows

On the main Folder of your project create new file and name it .gitignore, This file will be read by git gui every time and all statemens will taken in account for Not tracking files or folders.

If you want to exclude a folder called "bin" , write a new line in this file "gitignore" like this:

bin/

here the bin folder located in the main folder will be excluded, if the folder you want to exclude is a subfolder,then you need to write :

bin/subfolder/

Ok, after that you have to order Git to remove cached file and remember what you have done here.
from the command line "cmd.exe" , write the following:

c:\project\git rm -r --cached .

//Don't forget the dot in the end of the command line.

then : run the following command:

c:\project\ git add .


Now any chenges made to the folder you specified in gitignore file will not be tracked.




No comments:

Post a Comment