How to ignore files using git-gui (tcl-tk) application?

Édouard Lopez picture Édouard Lopez · Feb 26, 2014 · Viewed 20k times · Source

I'm using the git-gui interface to manage my git project. Despite being ugly –tcl-tk– it's one of the most complete interface out there.

However, I can't find how to ignore files from this interface ?

enter image description here

Answer

Daniel Schmidt picture Daniel Schmidt · Oct 9, 2015

the pragmatic way is, to add this to your git configuration:

git config --global guitool."Add to .gitignore".cmd $'echo "\n$FILENAME" >> .gitignore & git add .gitignore'
git config --global guitool."Add to .gitignore".needsfile yes
git config --global guitool."Add to .gitignore".confirm yes

Usage

After that, you can use it under Tools > Ignore selected file in your git gui. Select a file you want to ignore under Unstaged Changes -> Tools/ignore selected file

Ignore file with git-gui