Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.4k points)

I worked on the master branch and tried this git rebase -i HEAD~3. I actually tried to delete a commit from commit history but realized there was no need for that.

After the nano editor opened I made no changes to the file and closed it without saving. However, a message was displayed in the command line stating: "Successfully rebased and updated refs/heads/master ". What does that mean? I didn´t (as far as I know) do any changes. When I looked at git log and git status I saw no changes.

Afterwards, I made a couple of commits and pushed them to the remote.

My question is: Why was the message displayed? Did anything actually change?

I am asking this because this is actually a shared project and I was about to do a major mistake with rebasing something and now I am worried that I might´ve done so. As you can probably tell I am quite a n00b with git :)

Thank you for your help!

1 Answer

0 votes
by (12.4k points)

In this case, actually, nothing happened, everything it did result in the original commits.

So when it says "updated refs/heads/master" that means it changed the name master from identifying commit X to identifying commit X (for some hash ID X). It erased the older entry and replaced it with an absolutely identical entry. So nothing actually changed.

For more information on Git, you can join git training.

Browse Categories

...