Tag: git commands

git add。 vs git commit -a

有什么区别: git add . git commit -a 我应该做两个,还是多余的?

有没有更好的方法来查明当地的git分支是否存在?

我正在使用下面的命令来找出在我的仓库中是否存在一个branch-name的本地 git分支。 它是否正确? 有没有更好的办法? 请注意,我正在脚本内部执行此操作。 出于这个原因,如果可能的话,我想远离瓷器的命令。 git show-ref –verify –quiet refs/heads/<branch-name> # $? == 0 means local branch with <branch-name> exists. 更新 原来还有另一种方法 。 谢谢@ jhuynh 。 git rev-parse –verify <branch-name> # $? == 0 means local branch with name <branch-name> exists.