Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git Patch & Stash

Kylie
June 25, 2014

Git Patch & Stash

Super short talk on the git add --patch & git stash functionalities for Rails Girls ATL

Kylie

June 25, 2014
Tweet

More Decks by Kylie

Other Decks in Programming

Transcript

  1. git add —patch ! Stage this hunk [y,n,q,a,d,/,j,J,g,e,s,?]? y -

    stage this hunk n - do not stage this hunk q - quit; do not stage this hunk or any of the remaining ones a - stage this hunk and all later hunks in the file d - do not stage this hunk or any of the later hunks in the file g - select a hunk to go to / - search for a hunk matching the given regex j - leave this hunk undecided, see next undecided hunk J - leave this hunk undecided, see next hunk k - leave this hunk undecided, see previous undecided hunk K - leave this hunk undecided, see previous hunk s - split the current hunk into smaller hunks e - manually edit the current hunk ? - print help • allows staging parts(or “hunks”) of a file for a commit (git add -p)
  2. git stash • allows you to save the “dirty” or

    uncommitted state of your working directory git stash list [<options>] git stash show [<stash>] git stash drop [-q|--quiet] [<stash>] git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>] git stash branch <branchname> [<stash>] git stash [save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet] [-u|--include-untracked] [-a|--all] [<message>]] git stash clear git stash create [<message>] git stash store [-m|--message <message>] [-q|--quiet] <commit> !