user2835758
user2835758

Reputation: 11

All of my /User/{username} files and folders are in my .git folder for some reason

So currently I am trying to learn Git and am having a little trouble although many tutorials seem to be thorough and consistent.

When I type git init I get /Users/{username}/.git/ which seems to be ok since the tutorials also return the same path.

But when I type git status I get every file and folder (both hidden and non hidden) that is in my /Users/{username}/ directory for some reason, and it says all of those files/folders are untracked.

I don't want those files/folders in there as I only want my .git folder to contain my projects so I can proceed learning how to push projects into my remote repository (GitHub).

My system is Mac OSX, with OSX Sierra installed.

Upvotes: 1

Views: 1229

Answers (1)

Scott Weldon
Scott Weldon

Reputation: 10227

This is expected behavior. As you note:

it says all of those files/folders are untracked.

This means those files are not in the Git repo, Git is only telling you that there are files that may be added.

While you can work from your $HOME directory if you want, I wouldn't advise it. Instead, create a new folder just for your repo, and do your work there:

mkdir my-git-repo
cd my-git-repo
git init

To clean up the old Git repo, you can just delete it:

rm ~/.git

Upvotes: 2

Related Questions