The first time you manually push like that, you can add the -u flag (git push -u origin master) to push and set the branch’s default upstream. Afterwards, a plain git push while that branch is checked out will push the branch to that default upstream. This is per-branch, so you can have a main branch that pulls from one repository and a patch branch that pulls and pushes to a different repository.
My strategy is to just type git push and get some kind of error message about upstream not being set or something. That’s a signal for me to take a second to think about what I’m actually doing and type the correct command.
The first time you manually push like that, you can add the
-uflag (git push -u origin master) to push and set the branch’s default upstream. Afterwards, a plaingit pushwhile that branch is checked out will push the branch to that default upstream. This is per-branch, so you can have amainbranch that pulls from one repository and apatchbranch that pulls and pushes to a different repository.My strategy is to just type
git pushand get some kind of error message about upstream not being set or something. That’s a signal for me to take a second to think about what I’m actually doing and type the correct command.… google the error and randomly try stack overflow answers without really understanding them.
( I have changed)