I would like to add a file that matches .gitignore therefore does not show up in Github Desktop. Normally, git add -f ignoredFile will do it, but I would like to do it from within Github Desktop. Any way of doing that?
3 Answers
You can do it through the GitHub Desktop client UI.
On the Mac (should be similar to Windows), go to menu bar:
Repository -> Repository Settings -> Ignored Files
Add (copy the ignored from your .gitignore file) the ignored files in this text box and click save.
Then the ignored files should not be shown in uncommitted changes.
One thing to note that I have experienced using the Github Desktop GUI Client:
If you commit and sync a file that you later want to add to gitignore, the best way to do so is to remove the file from the repository, commit, and sync the change. Then re-import the same file into the file directory it was in and you will see the file ignored in the Desktop Client. I was experiencing issues of gitignore not grabbing the file to ignore, due to it being originally checked into the repository. The above fixes that small issue within the GUI Client.
- 121
- 1
I had the same problem. Here is what worked for me:
- edit (or even delete) the .gitignore file such that the file is no longer ignored
- make your commit (without including the change to .gitignore)
- discard changes to .gitignore
- 101