Say I have a feature branch, into which I merge upstream changes prior to pushing my changes back:
git branch feature1
... [edit my code]
... [commit]
git fe
[Edit] This is only a partial solution / workaround. See the actual answer by @djpohly below.
Firstly, you can push from anywhere. Doesn't matter what you have checked out, or whether the commits you want to push are in master.
git push REMOTE_REPO feature1:master
see git help push
Hint: git push remoteRepo localRef:remoteRef
As for bringing master to where you are now without fiddling with your working copy... You can force it like so:
# (while still on feature1 branch)
git checkout -B master origin/master
But this does a hard reset on master. ie it doesn't check for fast-forward.