git add ignored files from within Github Desktop

16,503

Solution 1

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.

Solution 2

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.

Share:
16,503

Related videos on Youtube

hyiltiz
Author by

hyiltiz

Updated on September 18, 2022

Comments

  • hyiltiz
    hyiltiz over 1 year

    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?

    • heavyd
      heavyd over 8 years
      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.
    • hyiltiz
      hyiltiz over 8 years
      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.
    • heavyd
      heavyd over 8 years
      In that case, you would need to find a different GUI that supports this feature.
    • hyiltiz
      hyiltiz over 8 years
      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
    hyiltiz over 7 years
    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.
  • Hao S
    Hao S almost 3 years
    I added the files by right-clicking add to .gitignore but they continue to show up under changes