-1

git has the following directories marked as "untracked files"

Desktop/
Documents/
Dropbox/
Library/

I'd like for git to ignore these files. I tried using this article but was unable to resolve my issue. Does anyone know of a visual step by step guide that may be of help? If not step by step terminal commands I can use to resolve my issue?

Suever
  • 64,497
  • 14
  • 82
  • 101
user3574939
  • 819
  • 3
  • 17
  • 34
  • 1
    What *specifically* did you try that you think should work (based on the link you provided yourself), but doesn't? Knowing that should allow for more useful answers by focusing just on the bit that you're having trouble with. –  Mar 05 '16 at 18:42
  • The article I listed is just one source. I have tried git revert, git filter-branch --tree-filter rm, git reset HEAD, and I've added the folders in .gitignore but .gitignore is also listed as untracked – user3574939 Mar 05 '16 at 19:03
  • Well, the article you linked to was the right one out of those. None of `git revert`, `git filter-branch` or `git reset` affect untracked files. Yes, creating a `.gitignore` file and then not adding it to Git means that file will be untracked itself (and it should be added to the repository and committed, generally, or itself mentioned in `.gitignore` in some special cases). But when you did that, did the directories still get listed as untracked as well? If so, something went wrong. Which is why it would help to see what you added to that file. –  Mar 05 '16 at 19:10

1 Answers1

2

First of all, you shouldn't be creating a git repository at the system level where these folders would even be identified as being part of the repository.

That being said, if you still must do it, you would add them to your .gitignore file with one directory per line. This file should exist within your project directory.

.gitignore

Desktop/
Documents/
Dropbox/
Library/
Suever
  • 64,497
  • 14
  • 82
  • 101