Skip to content

Instantly share code, notes, and snippets.

@tlberglund
Created September 22, 2012 20:43
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tlberglund/3767778 to your computer and use it in GitHub Desktop.
NFJS Atlanta Git Workshop

NFJS Git Workshop

  • Create a repo
    • git config --global user.name "Tim Berglund"
    • git config --global user.email "tlberglund@github.com"
    • git config --global color.ui auto
    • git init atlanta
  • Add files
    • Create caesar.txt
    • git add caesar.txt
  • Commit Files
    • git commit -m "First commit"
  • Look at diffs
    • git diff
    • git diff --staged
    • git difftool
    • git diff --word-diff
    • git diff HEAD
  • Look at history
    • git log
    • git log --pretty=raw
    • git log --prett=email
    • git log -1
    • git log --stat
    • git log --patch
    • git config --global alias.lg log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all"
  • Branch
    • git branch feature
    • git checkout feature
  • Merge
    • git checkout master
    • git merge feature
    • git merge feature --no-commit
  • Reflog
    • git reflog
  • Reset
    • git reset --hard <something>
    • git reset --hard HEAD@{1}
  • Log Live Gist
  • Win
@paaone
Copy link

paaone commented Sep 22, 2012

Thanks!

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