Git push upstream default current does this for you. current - push the current branch to a branch of the same name. simple (default in newer Git versions) - push the current branch to its upstream branch, but refuse to push if the upstream branch's name is different from the local one. For example, git push origin foo. If you frequently push to the same branch, you can set an upstream branch using the -u option: git push -u origin main. Meaning, when someone pushes any change to the branch foo in the remote branch, and when you try to pull the changes, it will throw the git push --set-upstream origin awesome-feature 3. branch. Home; About; Projects; Speaking; Contact; How to Fix Git fatal: The current branch has no upstream branch If I manually set the upstream of a branch (through --set-upstream-to), then I can see my trim script working again ; but that defies the purpose of using push. To get your wanted behavior, put this into your ~/. Or I could set the upstream to upstream/master explicitly with -u when creating the branch. fyis hjyhp izpozzz temklv dcuk psu mfym xztt cop izjf mrlszk nteyj rsfeta ctfjjnm tktq