Git push is not working after set the upstream remote branch to local branch

18 Views Asked by At

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".

0

There are 0 best solutions below