|
|
|
|
|
by nu11p01n73R
3184 days ago
|
|
> git config --global alias.git '!exec git' Is the exec really required? git config --global alias.git '!git'
Will also work. Am I missing something?EDIT:
From git doc,
"If the alias expansion is prefixed with an exclamation point, it will be treated as a shell command" So exec is not required then. |
|
Also, I found one caveat from the same docs:
> Note that shell commands will be executed from the top-level directory of a repository, which may not necessarily be the current directory. GIT_PREFIX is set as returned by running git rev-parse --show-prefix from the original current directory.
So, if I have a modified file `bar` in subdirectory `foo` under project root, and I am currently in `foo`, git status will show:
but git git status will show: To fix this, we should use cd first: