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

I faced this problem:

I see a very long list of com…


This content originally appeared on DEV Community and was authored by Dragoș Străinu

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

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

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.


This content originally appeared on DEV Community and was authored by Dragoș Străinu


Print Share Comment Cite Upload Translate Updates
APA

Dragoș Străinu | Sciencx (2022-02-17T20:21:23+00:00) Git: hide specific branch when doing git log –all. Retrieved from https://www.scien.cx/2022/02/17/git-hide-specific-branch-when-doing-git-log-all/

MLA
" » Git: hide specific branch when doing git log –all." Dragoș Străinu | Sciencx - Thursday February 17, 2022, https://www.scien.cx/2022/02/17/git-hide-specific-branch-when-doing-git-log-all/
HARVARD
Dragoș Străinu | Sciencx Thursday February 17, 2022 » Git: hide specific branch when doing git log –all., viewed ,<https://www.scien.cx/2022/02/17/git-hide-specific-branch-when-doing-git-log-all/>
VANCOUVER
Dragoș Străinu | Sciencx - » Git: hide specific branch when doing git log –all. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/02/17/git-hide-specific-branch-when-doing-git-log-all/
CHICAGO
" » Git: hide specific branch when doing git log –all." Dragoș Străinu | Sciencx - Accessed . https://www.scien.cx/2022/02/17/git-hide-specific-branch-when-doing-git-log-all/
IEEE
" » Git: hide specific branch when doing git log –all." Dragoș Străinu | Sciencx [Online]. Available: https://www.scien.cx/2022/02/17/git-hide-specific-branch-when-doing-git-log-all/. [Accessed: ]
rf:citation
» Git: hide specific branch when doing git log –all | Dragoș Străinu | Sciencx | https://www.scien.cx/2022/02/17/git-hide-specific-branch-when-doing-git-log-all/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.