I had some branch checked out locally. I committed a fist full och changes to it. Just when I was about to push them to the remote repo, I realized, I was working on the wrong branch.
I need to sort of 'move' those commits to the other branch, both locally and remotely, that is:
I have:
- local branch A plus changes (commited, not pushed),
- local branch B no changes,
- currently checked out local branch A
- remote branche A no changes,
- remote branch B no changes
And I need to end up with:
- local branch A no changes,
- local branch B plus changes (pushed),
- remote branch A no changes,
- remote branch B plus changes.
I am new to git and not a professional developer, so git-push(1) does not help me without further research.
I came across this post: git push command for pushing a local commit to a different remote branch
It suggests:
git push ssh://company.com:29418/platform/vendor/com-proprietary/ship/ftm 72bc75e409e50dcad29bd790b4b6478dc6668f12:jb_mr2
Obviously the jb_mr2
-part I change to whatever my branch B is called, but where do I get the rest of the numbers, and by what means do I get rid of the changes on branch A?