Git Cheat Sheet · Explore

Everything else, on the command line

git blame · git bisect · git reflog · git clean …

Some Git commands are used less often but save the day: git blame says who wrote each line, git bisect finds the commit that introduced a bug, git reflog finds a lost commit, and git clean deletes untracked files. In Merathon, you run them in the built-in terminal.

What it does

Commands without a dedicated button stay available in the integrated terminal, opened in the repository.

A use case

You want to know who wrote a line (blame) or find a commit lost after a reset (reflog).

On the command line

git blame <file>
The last commit, author and date of each line.
git bisect start · git bisect bad · git bisect good <commit>
Binary search for the commit that broke something.
git bisect reset
Ends the search and goes back to the starting branch.
git reflog
All of HEAD's recent positions, even after a reset or a rebase.
git clean -n · git clean -fd
Lists, then deletes, untracked files and folders.

In Merathon

  1. Open the bottom panel (Ctrl+J) then the "Terminal" tab.
  2. F5 refreshes the display after a command.

Frequently asked questions

How do I find a lost commit?

git reflog lists it; git branch rescue <hash> attaches it to a branch.

How long does the reflog keep history?

90 days by default for reachable entries, 30 days for the others. It stays local to your machine.

See also