I am new in git and I am practicing. I created a local branch but I saw that when I did git push my branch was not uploaded to the repository. I ha
I just experienced a further permutation of this issue.
I had a branch named feat/XYZ-1234-some-description because I was working on Jira issue 1234. During the work I created a new Jira issue to track a smaller piece of work, and when I came to push I decided to push to a branch name with this new issue number in:
git push -u origin feat/XYZ-5678-a-different-description # failed
This gave me the error being discussed in this SO thread. But since I was trying to push to a different branch name from my current branch, my problem was different to the one described here. I ended up renaming my local branch before I could push it:
git branch -m feat/XYZ-1234-some-description feat/XYZ-5678-a-different-description
git push -u origin feat/XYZ-5678-a-different-description # now works
After a bit more reading around I realised that I could have set a src on the
git push, either to the current branch name, or just HEAD if appropriate:
git push -u origin feat/XYZ-1234-some-description:feat/XYZ-5678-a-different-description # also works