Don't git mad, git even

Overview

  • General concepts 
  • Best Practices Once
  • Basic into Complex Commands
  • Revisit Best Practices
  • Triage

General Concepts

Comparisons

  • TFS
    • Snapshot vs. Entire repository
    • Centralized vs. Decentralized
  • Subversion
    • diffs vs files

Concepts

  • repository, branches, commits

  • remote vs. local

  • Hashes

  • Step 1 : You modify a file from the working directory.

  • Step 2 : You add these files to the staging area.

  • Step 3 : You perform commit operation that moves the files from the staging area. After push operation, it stores the changes permanently to the Git repository.

Best Practices

GUI vs CL

Principles

  • Atomic Commits
  • Committing early and often?
  • Committing versus stashing
  • think judiciously about .gitignore

  • employ pre-push hooks

Commands

  • git bash indicators
  • init
  • clone
  • config
  • pull
  • checkout
  • diff

    • —name-only

  • add

  • commit

  • commit messages

  • push

  • git log

    • ..

  • reset

    • HEAD and ~ vs ^

  • branch
    • -d
  • git aliases

  • git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"

  • merging and rebasing

  • cherry-pick

  • revert

  • blame

    • ​pitfalls

  • clean

    • ​-fdi

 

  • stash

  • stash pop

    • —keep-index

  • gitk

  • git bisect

  • reflog

Triage

  • THREE LEVELS OF TRIAGE

  • It’s messed up, I just need a clean slate; (git rebase —abort) git reset HEAD; git checkout .; git clean -fd; git pull
  • It’s messed up, but I need to save my work. copy files manually; follow step 1
  • approach 1 or 2 didn’t work: delete local repo; clone new;

Other examples of Unparliamentary Language

  • bastard
  • blackguard
  • coward
  • deceptive
  • dodgy
  • drunk
  • falsehoods
  • git
  • guttersnipe
  • hooligan
  • hypocrite
  • idiot

 

  • ignoramus
  • liar
  • pipsqueak
  • rat
  • swine
  • stoolpigeon
  • tart
  • traitor
  • sod
  • slimy
  • wart

Git

By qwertyisms

Git

  • 621