DEV Community

Cover image for Git: hide specific branch when doing git log --all
Dragoș Străinu
Dragoș Străinu

Posted on • Originally published at strdr4605.com

3 2

Git: hide specific branch when doing git log --all

I deploy https://strdr4605.com on Github pages. Deployment and hosting are on gh-pages branch.
When doing my usual check of branch status and history using:

git log --oneline --all --graph
Enter fullscreen mode Exit fullscreen mode

I faced this problem:

git gh-pages branch

I see a very long list of commits on gh-pages branch and I need to scroll down to see my other branches.

Solution

You can hide a specific branch using --exclude option for git log. Now my command looks like this:


git log \
--oneline \
--graph \
--exclude=refs/remotes/origin/gh-pages \
--all
Enter fullscreen mode Exit fullscreen mode

Now it looks better:

git hide gh-pages branch

You can add this command in a git alias.

If needed check here for more things to exclude from git log.

You can check why I prefer to do long commands instead of git aliases at How I use Git.

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay