So You Think You Know Git – Git Tips and Tricks by Scott Chacon

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • git-extras

    GIT utilities -- repo summary, repl, changelog population, author commit percentages and more

  • Yesterday I was actually trying to find out which are the top 10 file which were having most of the modifications after they were created and I stumbled upon https://github.com/tj/git-extras/blob/main/Commands.md

    Some great extra git command are there.

  • Git

    Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documentation/SubmittingPatches procedure for any of your improvements.

  • Boy, I can't find this either (but also, the kernel mailing list is _really_ difficult to search). I really remember Linus saying something like "it's not a real SCM, but maybe someone could build one on top of it someday" or something like that, but I cannot figure out how to find that.

    You _can_ see, though, that in his first README, he refers to what he's building as not a "real SCM":

    https://github.com/git/git/commit/e83c5163316f89bfbde7d9ab23...

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • git-blameall

    Shows every line that was ever in the file, along with information about when it was added or deleted.

  • Thanks, I knew about -committerdate but not that you can set it as default sort, super useful. A few notes...

    1. git columns gets real confusing if you have more data than fits the screen and you need to scroll. Numbers would help...

    2. git maintenance sounds great but since I do a lot of rebases and stuff, I am worried: does this lose loose objects faster than gc would? I see gc is disabled but it's not clear.

    3. Regarding git blame a little known but super useful script is https://github.com/gnddev/git-blameall . (I mean, it's so little known I myself needed to port it to Python 3 and I am no Python developer by any stretch.)

  • difftastic

    a structural diff that understands syntax 🟥🟩

  • Use the fantastic difftastic instead of git's diff. https://difftastic.wilfred.me.uk/

      [alias]

  • fzf

    :cherry_blossom: A command-line fuzzy finder

  • Those are the most used aliases in my gitconfig.

    "git fza" shows a list of modified/new files in an fzf window, and you can select each file with tab plus arrow keys. When you hit enter, those files are fed into "git add". Needs fzf: https://github.com/junegunn/fzf

    "git gone" removes local branches that don't exist on the remote.

    "git root" prints out the root of the repo. You can alias it to "cd $(git root)", and zip back to the repo root from a deep directory structure. This one is less useful now for me since I started using zoxide to jump around. https://github.com/ajeetdsouza/zoxide

  • delta

    A syntax-highlighting pager for git, diff, and grep output

  • Thanks for the difftastic & zoxide tips.

    However, I've been using this git pager/difftool: https://github.com/dandavison/delta

    While it's not structural like difft, it does produce more readable output for me (at least when scrolling fast through git log -p /scanning quickly

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts