Version control is necessary, but using it well is an art. Today I am going to give an overview of two Git commands that I found helpful during software development, git cherry-pick and git rebase in interactive mode.
Git Cherry-pick
Software development is often a team game. To work within the planned schedule, each developer will implement features in their own feature branches. But sometimes there are changes that everyone wants! git cherry-pick is a Git command that lets the developer pick a commit and apply it to their branch. This command comes in handy when you want to use features implemented by other developers but your branch isn’t built off their branch or when you just need to make one change but don’t want all of their changes right now.
As an example, consider this scenario: an existing bug made it into the main branch. A developer solves it in their branch. They’re still working on their branch, but you’re done with yours. Instead of waiting for the fix to make it into the main branch or creating an entirely new branch just for the fix, you can “cherry-pick” the commit that fixes the bug into your branch.
# Check out the branch you are interested in cherry-picking from
% git checkout <interested-feature-branch>
# Look for the commit SHA of the commit you want to cherry-pick
# Note: Press enter/return to scroll down the list and press q to exit
% git log
# Check out your branch
% git checkout <your-feature-branch>
# Cherry-pick the commit to your branch
% git cherry-pick <commit-sha>
Git Rebase Interactive
While cherry-picking can be valuable, it can also cause duplicate commits and can lead to unnecessary code conflicts during pull requests. To avoid this, we can “squash” the commits or drop the duplicated commit before creating a pull request. We can achieve this by using git rebase in interactive mode. Unlike the standard git rebase that rebases all commits to the desired branch, you have control over your commit history with an interactive git rebase.
# Check out your branch
% git checkout <your-feature-branch>
# Rebase interactively on another branch, e.g. master
% git rebase -i <another-branch>
# You can also use % git rebase --interactive <another-branch>
git rebase -i will list the commits on the current branch in a vim editor. You can remove or squash commits here.
The following is an example after calling git rebase -i.
pick 7cb4839 Old commit 1
pick e616408 Duplicate commit
pick 79bd7a2 Old commit 2
pick fcaf152 fixup! Old commit 2
pick bdcd3db Add new feature
# Rebase 0462d8f..bdcd3db onto 0462d8f (1 command)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# . create a merge commit using the original merge commit's
# . message (or the oneline, if no original merge commit was
# . specified). Use -c <commit> to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
If you are new to vim, you can go to the duplicate commit line and press d twice.
“Squashing” keeps the work on a commit but adds the changes to the commit before it. If you want to squash the fixup! Old commit 2 commit to the Old commit 2 commit, you can put your cursor over squash in the comments and type yiw, then put it over to the pick before the fixup! Old commit 2 commit and replace it by typing viwp.
# VIM Definition
yiw = yank inner word (inner = the word your cursor is on)
viwp = visual + inner word + paste
Now, the pick turns into squash, as seen here:
pick 7cb4839 Old commit 1
pick 79bd7a2 Old commit 2
squash fcaf152 fixup! Old commit 2
pick bdcd3db Add new feature
When you are satisfied with the changes, press esc to make sure you are out of any mode and enter :wq to save and continue rebasing. If there are merge conflicts, resolve them, and then use git rebase –continue to finish the rebase. If you are in the middle of rebasing and regret making some changes, you can reset everything back to its original state by using git rebase –abort. Once you see the following message, you can now push the commits to your remote.
Successfully rebased and updated
refs/heads/<your-feature-branch>.
Bonus: VSCode
If you are a VSCode user, the interactive rebase experience can be further improved by a VSCode extension called GitLens. Once the extension is installed, to enable the feature, open the command palette (for a MacBook user, enter command + shift + P), enter GitLens: Enable Interactive Rebase Editor, and press enter. Then, set up VSCode as the default editor for git, change directory to the repository, run git config –global -e, and add the following config key-value pair to the core section:
[core]
...
editor = code --wait
Now, whenever you run git rebase -i <target-branch> from the terminal, VSCode will open an interactive rebase GUI page for you to make changes to the commits.
With these Git commands, your commit history will look clean and clear while working in a team.
What’s Next For Your Embedded Project?
Mastering Git commands like cherry-pick and rebase -i isn’t just about cleaner commits — it’s about building reliable firmware faster, with fewer surprises and less rework. At Dojo Five, we believe embedded teams deserve the same modern tools and workflows that app developers take for granted.
That’s why we built EmbedOps — to give embedded engineers a consistent, modern development environment that makes version control, CI/CD, and team collaboration seamless. If you want to streamline builds, reduce friction in your process, and ship smarter, sign up for free and see how EmbedOps can support your workflow.
Have a tricky firmware challenge or an upcoming project you’d like to talk through? Let’s chat.
Let’s build better firmware, together.


