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.
The comamnd
git status
gives you the status of the working tree.
If you would like to 'use' the 'stash/master' tree you need to pull it with
git pull stash master
then the working tree will be pointing to 'stash/master'.
If you want to see what the pull will do before running it see: How to preview git-pull without doing fetch?
Addendum:
Look at the link below to see how to get you master branch to follow a different remote.
Make an existing Git branch track a remote branch?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With