I would do the following if I would be stuck with this problem:
1.) Rebase the commits between cbbe364
(exclusive) and 21b247a
(inclusive) onto your 8e9ccae
.
git rebase --onto 8e9ccae cbbe364 21b247a
This moves the commits c66dced
and 21b247a
directly onto 8e9ccae
. This will result in another hash value for the newest commit Add Binary Mobile, let's call the hash value 'commit2'
(Tree may not be 100% accurate, have no git repository to reproduce it)
* 8379515 (HEAD, origin/master, origin/HEAD, master) Merge branch 'binary-mobile'
|\
| * 21b247a (binary-mobile) Add Binary Mobile
| * c66dced Add Music Collection
| | cbbe364 Add task Music Collection
|/
|
|
| * commit2 (HEAD) Add Binary Mobile
| * commit1 Add Music Collection
|/
* 8e9ccae Update README.md
* 31d2050 Reorganize repo and add README files
* 88fe4fd Rename readme file
* 8ed72bd Reorganize the structure of the repo
* 219a25a Update README.md
* 60921e6 Create README.md
* 1de4f36 Initial commit
2.) After that move your master
down (down the 'Tree') to commit2
:
git branch -d master
git checkout commit2
git branch master
| * commit2 (HEAD, master) Add Binary Mobile
| * commit1 Add Music Collection
|/
* 8e9ccae Update README.md
3.) Now you have your master
where it belongs, namely on commit2
.
If you want to follow your branch on a 'single line', you need to get rid of binary-mobile
branch, just delete it:
git branch -D binary-mobile
Because the commit 21b247a
now has no branch name, and you do not work on this branch (no HEAD) the branch will disappear.
4.) Finally push your changes (force is necessary in this case). This will move your origin/master
down to master
, and the merge branch should disappear.
git push master --force
* commit2 (HEAD, master, origin/master) Add Binary Mobile
* commit1 Add Music Collection
* 8e9ccae Update README.md
* 31d2050 Reorganize repo and add README files
* 88fe4fd Rename readme file
* 8ed72bd Reorganize the structure of the repo
* 219a25a Update README.md
* 60921e6 Create README.md
* 1de4f36 Initial commit