git add ignored files from within Github Desktop

3

1

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?

hyiltiz

Posted 2015-10-26T00:26:32.847

Reputation: 276

Github Desktop is a convenient GUI to do the most common tasks, however it is not intended to do everything. You still have to drop down to the command line to do less common tasks. This falls under the less common tasks umbrella. – heavyd – 2015-10-26T05:06:35.283

I always found the CLI interface most intuitive, easy to use. However, I really do not like to make regular end users to poke their head into the terminal, especially when they do NOT enjoy doing that. – hyiltiz – 2015-10-26T23:59:32.787

In that case, you would need to find a different GUI that supports this feature. – heavyd – 2015-10-27T00:04:00.517

I liked SourceTree and SmartGit. However, as you can see, they are a bit complex for general purpose usage if you dont expect your collaborators to learn all those terminology and so on. – hyiltiz – 2015-10-27T00:18:30.873

Answers

3

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.

src3369

Posted 2015-10-26T00:26:32.847

Reputation: 131

I am not saying I want the ignored files to "now show up". I want to perform a git add -f ignoredFile.txt from within Github Desktop in a simple, clear and intuitive way. – hyiltiz – 2016-10-11T03:24:42.997

1

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.

SM23

Posted 2015-10-26T00:26:32.847

Reputation: 111