π This post is part of my "Shorts" series. Each post in this series is hyper-focused on a single concept and should take less than 1 minute to read.
In an earlier post, I introduced you to the powerful git-rebase
command. The syntax for the command is:
git rebase <baseBranch>
Rebase on anything
The baseBranch
need not necessarily be a branch. It can be anything - a tag, a commit ID, relative reference to HEAD
, etc.
For example, if you have a commit with ID as e92aa98f
, you can do:
git rebase e92aa98f
And voila, your feature branchβs base would change to this commit.
To be noted - for next post
The commit ID can be any commit, i.e., it can also be a commit that is already part of your feature branch. This ability to rebase on any commit is extremely useful for the purposes of rewriting history. You will find out more about this when I explore the interactive mode of git-rebase
in my upcoming post.
Top comments (0)