Fork me on GitHub

5/13/2013

Git alias problem

Recently, don't know why, I found the git aliasing does not work. When I use git st aliasing command, I got below error:

fatal: cannot exec 'git-st': Not a directory
Problem is /usr/bin/python is not directed to directory

After search for a while, I found it should be caused by my environment variable PATH.

Use the command echo $PATH |tr ':' '\n' |xargs ls -ld, I found there is a symbolic link in the list /usr/bin/python -> python2.7 If it is removed, the git aliasing problem is gone.

I think it should be noticed that the environment path should points to directories not to files.

[~]$ echo $PATH |tr ':' '\n' |xargs ls -ld

drwxr-xr-x 2 root      root         4096 Apr 17 09:52 /bin
drwxrwxr-x 2 brownylin brownylin    4096 Apr 25 09:41 /home/brownylin/Java/maven3/bin
drwxr-xr-x 2 root      root        40960 May  9 13:07 /usr/bin
lrwxrwxrwx 1 root      root            9 Apr 15 15:54 /usr/bin/python -> python2.7
drwxr-xr-x 2 root      root         4096 Apr 24 11:34 /usr/local/bin


References

Git alias problem
http://stackoverflow.com/questions/4019501/git-alias-problem

No comments:

Post a Comment