Skip to content

Instantly share code, notes, and snippets.

@matthewmccullough
Created September 13, 2012 04:06
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save matthewmccullough/3711787 to your computer and use it in GitHub Desktop.
Save matthewmccullough/3711787 to your computer and use it in GitHub Desktop.
Command Line History from San Francisco JUG 2012-09-11 Event

CLI History

git hash-object -t tree /dev/null

git init project1
echo "Hello World" > hello.txt
git add hello.txt
git commit -m"First hello"

printf “blob 12\000Hello World\n” | shasum
echo "Hello World" | git hash-object -w --stdin
cat .git/objects/55/7db03de997c86a4a028e1ebd3a1ceb225be238

alias deflate="perl -MCompress::Zlib -e 'undef $/; print uncompress(<>)'"
deflate .git/objects/55/7db03de997c86a4a028e1ebd3a1ceb225be238

git update-index --add --cacheinfo 100644 557db03de997c86a4a028e1ebd3a1ceb225be238 hello.txt

git cat-file -t 4fd1
tree .git
git cat-file -p 4fd1
git cat-file -t 97b4
git cat-file -p 97b4

cp -r project1 project1damaged
cd project1damaged
git log -1
vim .git/objects/4f/d10bba3b8f15bdf3ff283f8135b6be8f5998f2
git status
git fsck
git fsck --full --strict
cd project1
git branch feature1
git branch
git checkout feature1
git l2
git merge-base master
git merge-base master feature1
git checkout master
git merge feature1 
git rev-parse 4fd1
git tag IJUSTLEFTMYCOMPUTERFORCOFFEE21
generaterandomchanges 2 sample2 txt
git tag NORMALTAG
git tag -a SAMPLEWITHANNOTATED
tree .git/objects
git cat-file -p 0188
git rev-parse SAMPLEWITHANNOTATED
git rev-parse IJUSTLEFTMYCOMPUTERFORCOFFEE21
git cat-file -t d22c
git cat-file -t 0188

git clone git@github.com:githubtraining/hellogitworld
git ls-files
git ls-remote
git ls-remote | more
git branch -v
git rev-parse HEAD
git cat-file -t HEAD
git cat-file -p HEAD
git rev-parse 'master^{tree}'
git describe --tags master 
git tag
git tag -a ANANNOTATEDONE HEAD~1
git describe HEAD
git describe master
git log --stat
git show c594793
git show c594793:build.gradle
git show c594793:build.gradle | mate
git branch feature2
generaterandomchanges 2 master txt
git checkout feature2
generaterandomchanges 2 feature txt
git merge master
to.scratch
cd hellogitworld

git show HEAD
history | tail -5
history
clear
git log
git gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment