Hacker News new | ask | show | jobs
by PaulJulius 3475 days ago
I'm going to describe a small issue I've been having with Git that I've tried Googling for in the past but have never found a solution.

I use a custom `git log` alias that prints out a nicely colored commit graph.

  [alias]
    lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all -n 15
The issue is that this includes everyone else's branches that have been pushed to origin. I only want to see the history for local branches. (I guess I'd also want to be able to see origin/master, but I recognize that there's nothing distinguishing that from the other branches on origin I don't want to see.)

I think the issue is that I run `git pull --prune` to get rid of any remote branches that have been deleted. I usually do this after I pull master, so I think I should just be running `git pull origin master --prune` as a single command.

1 comments

Replace `--all` with `origin/master --branches`.