Skip to content
AcDcPlasma edited this page Jul 7, 2018 · 3 revisions

git rev-parse [branch] : show SHA-1 of specified branch

git log A..B : show commits reachable by B which are not reachable by A also written as [git log ^A B], and [git log B --not A]

git log B..A : show commits not in B but in A

git hash-object -w --stdin : write to file content from stdin git cat-file -p [SHA-1] : print content of commit identified SHA-1 git cat-file -p "@^{tree}" : print tree entries of tree object of HEAD

git update-index --add --cacheinfo [100644/100755/120000] [filename] [SHA-1] : stage file to filename from SHA-1 git write-tree : write tree from currently staged files git read-tree --prefix=[subdirectory name] [SHA-1] : create subdirectory from SHA-1 into subdirectory name

git commit-tree [SHA-1] [-p SHA-1] and then input commit message : create commit. -p option specify parent commit

Clone this wiki locally