Search code examples
gitgithubgit-stash

How can I see what are the steps involved in any git command


Is there any way or neat documentation where I could see what are all the steps or stages when we run a git command.

For example, when we do a git pull. I believe

  • git fetch is run
  • then git pull

But that's something I devised from logs. Is there any way I could actually see what is run as part of a git command e.g. git stash -p. I tried to search for a documentation etc but didn't find anything.

Please help!


Solution

  • I believe what you need are those commands:

    GIT_TRACE=1 git fetch origin master
    GIT_TRACE=1 git pull origin master
    

    git have plenty of different debug tags. You can find them here:

    https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#Debugging