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

21,825

Solution 1

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

Solution 2

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.

Solution 3

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.

Share:
21,825

Related videos on Youtube

Édouard Lopez
Author by

Édouard Lopez

Motivation I'm a quality-driven full-stack developer loving UX and devOps. Workflow include TDD and tests ; pair-programming ; code-review ; Trunk-based development ; Agile related. Languages and Tools Frontend: JS, ES6+, ReactJS, Vue.js, EmberJS, Angular, webpack/rollup ; test: unit Jest, AVA, end-to-end Cypress Backend: Python, Flask, Django, Unittest and Pytest ; DevOps: Docker/compose/Docker.py, Ansible ; Shell: bash/sh, fish, powershell test: Bats, fishtape, Pester Bonus I'm familiar with: UX (User eXperience) ; Accessibility ; Data-visualization ; IA (Information Architecture).

Updated on March 01, 2020

Comments

  • Édouard Lopez
    Édouard Lopez about 4 years

    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

    • iberbeu
      iberbeu about 10 years
      I'm afraid this is not possible. You can put a ticket or use another tool or the command line
    • iberbeu
      iberbeu about 10 years
      The only thing I found related to it is this ticket 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
  • Édouard Lopez
    Édouard Lopez about 10 years
    I'm looking for the GUI equivalent of that
  • Édouard Lopez
    Édouard Lopez over 8 years
    Looking for a GUI process, I'm aware of the .gitignore file
  • Sankalp
    Sankalp over 7 years
    What is the value that I should put for $FILENAME, but still after running command 2nd and 3rd, I can see 'Ignore' option under Tools
  • Lucas Bustamante
    Lucas Bustamante over 7 years
    Very nice! Thanks!
  • SuB
    SuB over 4 years
    Good trick but simple. It can't handle ignoring a prefix or a folder.