20

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

Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178
  • 2
    I'm afraid this is not possible. You can put a ticket or use another tool or the command line – iberbeu Feb 26 '14 at 16:20
  • 1
    The only thing I found related to it is this ticket https://code.google.com/p/msysgit/issues/detail?id=115 It can means nothing but if there is no way to edit `.gitignore` i guess it is not possible to do it with the ui either. Any way there is no option in the menus and also no related info on the internet – iberbeu Feb 26 '14 at 17:21

4 Answers4

30

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

Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178
Daniel Schmidt
  • 316
  • 3
  • 5
4

If you mean ignore them forever, then add a .gitignore file in the root of your directory (where the .git folder is). List the files or file types separated by a new line like so:

*.pyc
venv
.metadata

If you mean ignoring it temporarily, you can do the .gitignore step or just stage the files you want to commit individually.

Dan Hoerst
  • 6,222
  • 2
  • 38
  • 51
2

If you set it in your .gitconfig file, the GUI will comply.

Add this to your .gitconfig (should be located under c:\users\USERNAME)

[core]
    excludesfile = ~/.gitignore

Then create a file c:\users\USERNAME\.gitignore

and add the ignore files to that.

Abby Fichtner
  • 2,598
  • 2
  • 17
  • 20
-2

You can try to add all the files first. After that go to git gui, choose those files you want to ignore in "Staged Changes" and press Ctrl-U.