开发者

Git status shows untracked file on a higher level?

I just cloned a git repository from my server to my local machine. I wanted to see if everything was ok so I made a git status and my suprise is that 开发者_开发知识库folders in a level higher than my git repository appear as untracked, "../joomla/", does this make any sense to you?


( This is a guess since you haven't given a lot of detail. But this is a possible scenario):

You had a repo and you cloned it. You ran git clone url/to/repo.git from your directory say /home/repos/my

Now after the clone, you try git status and shows untracked files from /home/repos.

So how is this possible?

1) You must have had a .git folder ( probably an artifact of previous failed clone, etc) in /home/repos ( or even /home etc.)

2) Since you did git clone url/to/repo.git, git would have created a folder repo at /home/repos/my/repo. But you did the git status from /home/repos/my. So git goes to parent folders looking for .git and found it ( as per 1) and hence shows untracked files.

So see if 2) is your case. Try changing directory to the folder that git has created. Usually you should do a clone as git clone url/to/repo.git . ( . at end) if you are already in the folder where you want the repo to be.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜