Skip to content

Instantly share code, notes, and snippets.

@schacon
Created August 18, 2011 04:51
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save schacon/1153310 to your computer and use it in GitHub Desktop.
Save schacon/1153310 to your computer and use it in GitHub Desktop.
plumbing cheat sheet

the plumbing commands

  • rev-parse [something]

    • show the SHA of any weird git phrase
  • hash-object -w [file]

    • take any file or stdin and return a blob sha
  • ls-tree (-r) [sha]

    • show the entries of a git tree in the db
  • ls-files -s

    • show the entries of the index
  • read-tree

    • make the index look like a git tree in the db
  • update-index

    • take an existing blob or a file from the work tree and update the index entry
  • write-tree

    • record the current state of the index into a git tree in the db and return the sha
  • commit-tree

    • create a commit object from a git tree in the db
  • update-ref

    • update a branch (or other reference) to point to a specific commit sha
  • symbolic-ref

    • update a reference (usually HEAD) to point to another reference (like a branch)
@ddcz12
Copy link

ddcz12 commented Sep 15, 2018

What about cat-file -p and cat-file -t?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment