Debugging git
aliases with shell commands and quoting can be difficult.
How can I see what git
is executing for a given alias?
How it works? git bisect start: It start up the git bisect wizard. git bisect bad “version”: It let the git bisect wizard know of a bad commit. git bisect good “version”: It let the git bisect wizard know of a good commit.
Your git aliases are often stored per your user's configuration at ~/. gitconfig . You can also manually set aliases using, for example, the command git config alias. s 'status -s' .
Git aliases are a powerful workflow tool that create shortcuts to frequently used Git commands. Using Git aliases will make you a faster and more efficient developer. Aliases can be used to wrap a sequence of Git commands into new faux Git command.
In your .gitconfig
, add the following:
debug = !GIT_TRACE=1 git
Then you can run git debug <aliasname>
, for example:
$ git debug s 17:34:48.611406 git.c:563 trace: exec: 'git-s' 17:34:48.611696 run-command.c:336 trace: run_command: 'git-s' 17:34:48.613262 git.c:286 trace: alias expansion: s => 'status' '--short' 17:34:48.613338 git.c:563 trace: exec: 'git-status' '--short' 17:34:48.613350 run-command.c:336 trace: run_command: 'git-status' '--short' 17:34:48.615319 git.c:350 trace: built-in: git 'status' '--short' M app/models/user.rb M test/integration/users_edit_test.rb ?? html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With