I base git remote myproject on remote upstream from github. Now I have branch master tracking myproject/master but want to have another branch tracking upstream/master, so I create branch upstream-master.
- Getting changes from upstream/master is easy, just do git pull upstream when on local/master
- It is good to have a local branch upstream-master to prepare commits to upstream/master
- To copy commits from master to upstream-master: git merge master
- To see pending commits on upstream-master: git log @{upstream}..
- To automatically squash merge commits and such: git rebase -i @{upstream}
For some reason one cannot automatically push from local/upstream-master to upstream/master. This works:
git co upstream-master
git push upstream HEAD:master
This is ineffective, upstream is not changed
git co upstream-master
git push --set-upstream upstream HEAD:master
This affects local/master
git co upstream-master
git push --set-upstream upstream master
Why is it not possible to configure so that git push wih no arguments pushes from local/upstream-master to upstream/master?