0

I have a two branch called NB1 and NB2, Those branch present in remote repository

I have set a upstream as "git branch --set-upstream-to=origin/NB1 NB2"

Then switch the branch to NB2, Now I have committed changes in the NB2

Now I try to push the changes to upstream with command "git push"

So I got this error :

fatal: The upstream branch of your current branch does not match the name of your current branch. To push to the upstream branch on the remote

In the internet I have read the more content like, Once we set upstream branch then we push changes from the local branch to remote branch.

I expectation is as per more internet content, I have to achieve the push changes with "git push", But I had only achieve the push with "git push origin NB2:NB1".

  • https://stackoverflow.com/search?q=%5Bgit-push%5D+fatal%3A+The+upstream+branch+of+your+current+branch+does+not+match+the+name+of+your+current+branch – phd Aug 09 '23 at 13:25
  • `git config --global push.default upstream` – phd Aug 09 '23 at 13:25
  • "git config --global push.default upstream" this command is resolving I have mentioned issue – Parameshwaran Aug 09 '23 at 13:52

0 Answers0