0

I'm not quite sure how I've ended up in this state but for some reason git is detecting everything under my c:\Users directory as being untracked files so when I do a git status I get the following:

>git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    ../../../3D Objects/
    ../../../AppData/
    ../../../Contacts/
    ../../../Desktop/
    ../../../Documents/
    ../../../Downloads/
    ../../../Favorites/
    ../../../Google Drive/
    ../../../Links/
    ../../../Music/
    ..... and many more

Obviously I don't want these to be tracked or committed. How can I remove these from being tracked in git without deleting any files from my file system

Andrew
  • 2,315
  • 3
  • 27
  • 42
  • Just create a `.gitignore` file - see here https://git-scm.com/docs/gitignore – Syntax Error Oct 08 '18 at 09:48
  • Did you accidentally create a new Git repository, or cloned one into a very top-level directory, or moved a `.git` directory around manually? – mkrieger1 Oct 08 '18 at 09:51
  • Ah, judging by `no commits yet`, it seems you've somehow created a new Git repository which you apparently didn't mean to. – mkrieger1 Oct 08 '18 at 09:52
  • @mkrieger. Yeah that's what seems to have happened! – Andrew Oct 08 '18 at 09:53
  • 1
    @mkrieger. Yes, that was the one thanks! I obviously must have ran git init against my c:\users at some point and not realised. – Andrew Oct 08 '18 at 10:00

0 Answers0