Replacing (HEAD -> master) commit with the (origin/master, origin/HEAD) commit

Viewed 118

The HEAD -> master commit is the most recent one.

I want HEAD -> master to disappear from my log. I want (origin/master, origin/HEAD) to be the code pushed to the repo.

How do I go about this?

I was thinking about a rebase but was wondering if there was an easier way to go about this.

With a rebase there are usually merge conflicts which I have to resolve. When doing so, I might accidentally break something.

1 Answers

If a git log --decorate --oneline show

(HEAD -> master, origin/master)

then, a commented, master is already pushed to origin

Considering HEAD is always present, you would not be able to "not see HEAD -> master", unless you do:

git switch --detach

Then your HEAD would be detached, and you would see:

(HEAD, origin/master)

Make sure to not add commits on a detached HEAD though (it works, but those commits are not referenced by any branch)

Related