2013-03-15 100 views

回答

11

您可以使用Git的GIT_TRACEenvironment variable来获取执行的命令的详细跟踪。例如:

GIT_TRACE=true git flow feature start bar 

... ...显示

trace: exec: 'git-flow' 'feature' 'start' 'bar' 
trace: run_command: 'git-flow' 'feature' 'start' 'bar' 
trace: built-in: git 'config' '--get' 'gitflow.branch.master' 
trace: built-in: git 'branch' '--no-color' 
trace: built-in: git 'config' '--get' 'gitflow.branch.develop' 
trace: built-in: git 'branch' '--no-color' 
trace: built-in: git 'config' '--get' 'gitflow.branch.master' 
trace: built-in: git 'config' '--get' 'gitflow.branch.develop' 
trace: built-in: git 'config' '--get' 'gitflow.branch.master' 
trace: built-in: git 'config' '--get' 'gitflow.branch.develop' 
trace: built-in: git 'config' '--get' 'gitflow.origin' 
trace: built-in: git 'config' '--get' 'gitflow.prefix.feature' 
trace: built-in: git 'branch' '--no-color' 
trace: built-in: git 'branch' '-r' '--no-color' 
trace: built-in: git 'branch' '--no-color' 
trace: built-in: git 'branch' '-r' '--no-color' 
trace: built-in: git 'checkout' '-b' 'feature/bar' 'develop' 
Switched to a new branch 'feature/bar' 

Summary of actions: 
- A new branch 'feature/bar' was created, based on 'develop' 
- You are now on branch 'feature/bar' 

Now, start committing on your feature. When done, use: 

    git flow feature finish bar 

如果你想比这更多的细节,你可以使用sh shellxtrace选项:

展开每个简单的后命令,用于命令,大小写命令,选择命令或算术命令,显示PS4的扩展值,后跟命令及其扩展参数或相关单词列表。

编辑git-flow脚本并在#!/bin/sh第一行之后加上set -x。执行上述命令,git flow feature start bar将显示大量信息(超过可以包含在答案中)。

+0

NEATO!每天学些新东西... – the0ther 2015-05-14 20:11:44

1

通过检查the source可以看到每个命令的功能。它有很好的文档记录,所以即使不知道bash,你也可以了解发生了什么。

实际上,在检查源代码后,似乎确实有办法记录git流在内部使用的命令;至少大部分是。该功能被引入with this commit和提示show_commands设置。您应该可以使用--show_commands启用它,它会打印出大多数内部使用的git命令。

1

使用--showcommands开关,例如:

git flow feature start FEATURENAME --showcommands 
相关问题