有没有办法让git flow显示它在幕后执行的命令?

时间:2013-03-15 19:06:25

标签: git git-flow

有没有办法让git-flow提前告诉我在执行flow命令时它将执行的确切git命令;还是告诉我,因为它是洞呢?

我能看到输出和摘要吗?

4 个答案:

答案 0 :(得分:11)

您可以使用Git的GIT_TRACE environment 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 shell xtrace选项:

  

扩展每个简单命令后,对于command,case命令,select命令或arithmetic for command,显示PS4的扩展值,然后显示命令及其扩展参数或相关词列表。

修改git-flow脚本并在set -x第一行后面添加#!/bin/sh。执行上述命令git flow feature start bar会显示大量信息(可以包含在答案中)。

答案 1 :(得分:1)

Some commands have a verbose flag,但我相信你问题的答案是“不”。

答案 2 :(得分:1)

通过选中the source,您可以查看每个命令的作用。它有很好的文档记录,因此即使不知道bash,你也可以理解发生了什么。

实际上,在检查源之后,确实有一种方法可以记录git flow在内部使用的命令;至少大多数人。该功能已引入with this commit以及show_commands设置的提示。您应该能够使用--show_commands启用它,它将打印出内部使用的大多数git命令。

答案 3 :(得分:1)

使用git flow feature start FEATURENAME --showcommands 开关,例如:

<main>
    <h1>
        <a>Mycat</a> <!-- why anchor? -->
    </h1>
    <form id="search" action="#" method="post">
        <span id="label1">
            <label for="search-terms" id="search-label">search</label>
        </span>
        <span id="input1">
            <input type="text" name="search-terms" id="search-terms" placeholder="Enter search terms..." />
        </span>
    </form>
    <div id="divleft""> 
        <h1>
            <a>shipment</a> <!-- why anchor? -->
        </h1>
    </div> 
</main>