git seems to have suddenly gone a bit haywire on my machine.
chris-greenings-macbook-2:tankgame chris$ pwd
/Users/chris/Work/Tanks/Android/tanks/src/com/cmgresearch/tankgame
chris-greenings-macbook-2:tankgame chris$ ls
GL2JNIActivity.java IKeyboardServices.java Properties.java SoundEngine.java_free
GL2JNILib.java OrientationListener.java Properties.java_free TouchEvent.java
GL2JNIView.java OrientationManager.java SoundEngine.java
chris-greenings-macbook-2:tankgame chris$ 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)
#
<snip>
# modified: ../../../../../../Android/tanks/src/com/cmgresearch/tankgame/GL2JNIView.java
<snip>
Why is it doing all the ../../../../../../.. when the changed file is in the current directory?
If I try and do git add GL2JNIView.java it ignores me and doesn't think there are any changes to commit.
If I add the full ../../../../../../Android/tanks/src/com/cmgresearch/tankgame/GL2JNIView.java
then I can comm开发者_如何学Goit the changes.
Even doing
git add *.java
Will not add the changed files.
I'm sure this used to work - and I haven't changed anything in my setup. Is there some settings that stops you using the current directory in git?
I'm running on macosx lion.
git version 1.7.5.4
Edit - rebooted the machine and now it's behaving as normal. Anyone have any ideas why it got into the funny state?
Check the casing in your path as you CD into it. This is what causes the issue. When entering each directory, tab complete the name. Git is case sensitive.
Hope this helps next time.
精彩评论