0

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.

bamboo10
  • 133
  • 2
  • 12

1 Answers1

2

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.

Greg Hewgill
  • 828,234
  • 170
  • 1,097
  • 1,237
  • Sure enough, git things root directory is my User space. So I just need to find a way to change that? – bamboo10 Nov 28 '13 at 00:03
  • 1
    Normally, Git searches upwards from the current directory looking for a `.git` directory (that signifies the root of a repository). Do you have a `.git` directory in your current (project) directory? (you should.) Do you have one in your home directory? (you probably shouldn't.) – Greg Hewgill Nov 28 '13 at 00:37