I have to remote repositories
$ git remote show
repoA
origin
git push
will push changes to origin, how can I change the push destination so that it goes to repoA's url? I know I could use git push repoA branch
but I want to just push to repoA master for now.
If you want to push just for now, you can run this command:
git push <REMOTENAME> <BRANCHNAME>
If your remote branch has different name than your local branch, you can run like this:
git push <remote-name> <local-name:remote-name>
If you want to set as default upstream git push behavior you can do like this:
git push -u <remote name> <local name>
or checkout to local branch and run:
git branch --set-upstream-to <remote-name>
and every time you run git push and gonna push to the repository you set
To validate the branch is setup with the correct upstream remote:
git branch -vv
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