Git Recipes

This page contains a whole lot of Git commands that I personally used in the past to keep as a track record for future use.

Navigating history



Getting a single file from a stash…

Stash all files including untracked files…

Save a stash with a specific message…


Add specific lines of a file to the commit interactively.

Commit the staged changes.


Trace buggy commit with git bisect…



Filter Branch

Fix committer/author

Remove filter-branch backup

Move commits to new Repository

These examples assume you are already on the branch you want to cherry-pick these commits into.

Take a specific subset of commits

Take all commits involved in a specific merge commit

Handle deleted files and conflicts

As you are cherry-picking your target branch might not have all files. You might end up in some conflicts that you will have to handle.

Git config