当我签出标签时,我得到了这个输出:
λ git checkout REL-6.2.0
Note: checking out 'REL-6.2.0'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at c154795... Set REL-6.2.0 in pom.xml on release/6.2.0 branch.
有没有办法让输出少一点或没有git checkout
-b提案?我知道我可以使用> /dev/null
这样的东西,但我想要一些输出,但只需要更少
答案 0 :(得分:3)
从git checkout
的{{3}},您可以使用--quiet
标记来抑制某些类型的输出:
git checkout --quiet # or just -q
我刚刚使用--quiet
标志在分离头状态的本地分支上检出了先前的提交,并且Git在控制台中没有输出。相反,我刚刚看到了新提示:
/c/users/timbiegeleisen/documents/project ((9e51b34...))
答案 1 :(得分:1)
Tim Biegeleisen的回答解释了如何抑制单个结账的消息。
如果您想永久禁止消息,可以使用advice.detachedHead
:
git config advice.detachedHead false
像往常一样,这只会影响当前的回购。添加选项--global
以全局设置(对于您的本地用户帐户)。