It is not clear what you want to do but since my attempt to get you to explain in more detail what you want (or to get moderators of this site to close the issue because you don't do that) have failed, I am answering some questions that you did not actually ask.
Based on the screenshot (but for the most part ignoring what you have written) I am going to assume that your question is one of:
How do I merge topic2
into master
?
Type m m topic2
RET.
If you put the cursor on the add f2
line first, then you could also just m m RET because topic2
would be the default in that case.
How do I reset master
so that it points at the same commit as topic2
?
In a situation like the one in the screenshot you should just merge topic2
as I have just described. But if the situation looked like this instead:
* [master] something else
| * [topic2] add f2
|/
* add f1
* add f0
Then a merge would result in this:
* [master] Merge branch 'topic2'
|\
| * [topic2] add f2
* | something else
|/
* add f1
* add f0
Maybe that's what you want - I have no way of knowing. But if you want this instead:
* [master] [topic2] add f2
* add f1
* add f0
then move to the [topic2] add fs
line and type C-u x RET.
git branch -f <branchname> <startpoint>
will reset<branchname>
to commit<startpoint>
. In your case, this will not affectmaster
branch in any way. Instead, this will basically, aliasmaster
asbranchX
. I'm not sure why would you want to do it, and I never tried to do this frommagit
. Can you explain what's the end-result you want to achieve?