bamboo10
bamboo10

Reputation: 133

Git seems to track every single file on drive

For some reason when I set up my git repository git clone lists all the files in that particular drive, i.e.

% git status  # On branch master 
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   deleted:    index.html
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   ../../../-framework dla ASHA
#   ../../../.CFUserTextEncoding
#   ../../../.Trash/
#   ../../../.Xauthority

The output is much longer which makes project management a bit of a pain.

I have no idea why this happened, I have used git before but never had this problem which makes me think I missed something obvious.

Upvotes: 0

Views: 110

Answers (1)

Greg Hewgill
Greg Hewgill

Reputation: 994051

Use the following command to find out what Git thinks the root directory of your project is:

git rev-parse --show-toplevel

Given that, you might be able to discover something about why Git is doing what you observe.

Also check to make sure that you don't have an unexpected value set for the GIT_DIR environment variable.

Upvotes: 2

Related Questions