Git cheat sheets are a dime-a-dozen but I think this one is awfully concise for its scope.

  • Visually covers branching (WITH the commands – rebasing the current branch can be confusing for the unfamiliar)
  • Covers reflog
  • Literally almost identical to how I use git (most sheets are either Too Much or Too Little)
You are viewing a single thread.
View all comments
4 points
*

git has 17 million options

proof needed /s

I wonder how many it actually is.

permalink
report
reply
3 points
*

According to tab autocomplete…

$ git
zsh: do you wish to see all 141 possibilities (141 lines)?

But what about the sub options?

$ git clone https://github.com/git/git
$ cd git/builtin
# looking through source, options seem to be declared by OPT
# except for if statements, OPT_END, bug checks, etc.
$ grep -R OPT_ | grep --invert-match --count -E \
"OPT_END|BUG_ON_OPT|if |PARSE_OPT|;$|struct|#define"
1517

Maybe 1500 or so?

edit: Indeed, maybe this number is too low. git show has a huge amount of possibilities on its own, though some may be duplicates and rewords of others.

$ git show --
zsh: do you wish to see all 489 possibilities (163 lines)?
$ man git-show | col -b | grep -E "^       -" --count
98

An attempt at naively parsing the manpages gives a larger number.

$ man $(find /usr/share/man -name "git*") \
| col -b | grep -E "^       -" -c 
1849

Numbers all over the place. I dunno.

permalink
report
parent
reply
3 points

That’s less than I expected. If there’s 141 commands that on average comes down to 10 per.

permalink
report
parent
reply

Programming

!programming@programming.dev

Create post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Community stats

  • 3.8K

    Monthly active users

  • 800

    Posts

  • 6.5K

    Comments