另一个远程的git状态 [英] git status of another remote
问题描述
我增加了第二个遥控器:
git remote add stash ...
然而,当我这样做的时候
git status
它检查origin / master的状态。我怎么能发出一个git状态来检查第二个远程的状态,在这种情况下是隐藏。我尝试了以下命令,但它们仍然跟踪origin / master:
git status stash / master
git status
预先感谢您的输入!
如果你想改变它,你需要改变分支正在跟踪的内容。你可以通过多种方式来做到这一点。对于新版本的git使用
git branch --set-upstream-to = stash / master
请注意, stash
是Git中的一个命令,因此我不建议将它用作远程名称,因为它可以造成潜在的困惑。
I added a second remote by issuing:
git remote add stash ...
However, when I do
git status
It checks for the status of origin/master. How can I issue a git status to check for the status of the second remote, in this case "stash". I tried the following commands, but they still track origin/master:
git status stash/master
git status "stash/master"
Thanks in advance for the input!
git status
uses the configured information for the branch in the repository config file ( (repo)/.git/config) to show status.
If you wish to change that, you will need to change what your branch is tracking. You can do that a variety of ways. For newer versions of git use
git branch --set-upstream-to=stash/master
Note that stash
is a command in Git, so I would not recommend using it as a name for a remote because it could cause potential confusion.
这篇关于另一个远程的git状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!