If you have ever stared into the abyss of commit history and guessed where a branch vanished then this command is your mild salvation. The git log graph option paints a quick ASCII map of commits on the command line so you can stop squinting and start blaming the right merge.
git log --graph --oneline
When you do not want a novel in your terminal add one line output and decorations to show branch names tags and short messages in a single view. This keeps your mental RAM free for actual decisions.
git log --graph --oneline --decorate
Curious about those phantom commits from CI or a remote your colleague refuses to explain Use the all branches and remotes flags to stop assuming they do not exist.
git log --graph --oneline --decorate --all --branches --remotes
Colors and a tight format make it easier to scan a messy merge history. Replace the fields below to match your taste. Shorter hashes and concise messages work best when you are trying to find that one commit that broke everything.
git log --graph --pretty=format '%C(yellow)%h %Creset%s %C(green)(%cr) %C(bold blue)' --all
You can swap %h for %H if you need full hashes or add %an to show the author. Keep the format short so the graph lines and messages stay side by side.
When you want to copy a commit hash for a PR add line numbers or use a pager. This reduces the chance of grabbing the wrong hash and then apologizing to humans you work with.
git log --graph --oneline --decorate --all | nl -ba | less -R
Try these commands on your repo and tweak the pretty format to match your workflow. The goal is to make the command line feel less like punishment and more like a map that points at the thing that is wrong.
If you want more tricks ask for aliases and git config snippets to save typing and dignity.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.