Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week...

13
Week 8: Cherry Picking and Reflog Jonathan Miedel Alvin Wang Shannon Lee

Transcript of Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week...

Page 1: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes

Week 8: Cherry Picking and Reflog

Jonathan MiedelAlvin Wang

Shannon Lee

Page 2: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes

● We had a midterm

Last Week in Git Stuco

Page 3: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes

Midterm

Page 4: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes

Average = 45.375Standard Deviation = 4.81966

Exam Grade Distribution

Page 5: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes

● git cherry-pick <commit>● Like a mini rebase● It applies the changes of one commit to

your location● Can be used to select a single bug-fix

git cherry-pick

Page 6: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes
Page 7: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes

● Given branch with 3 commits● git rebase -i HEAD~3● Doesn’t work as you would expect● --root

Rebasing with the First Commit

Page 8: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes

● The reflog keeps track of updates to branches

● Allows us to reconnect dangling branches

git reflog

Page 9: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes
Page 10: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes

Undoing Rebase????!?!?!?!? WHAT!

Page 11: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes

● <commithash> or <partialcommithash>● <refname>● @{} - uses reflog

○ @{yesterday} ○ @{n}

● ^{n} - nth parent● ~{n} - nth generation ancestor

● A..B select commits in a range

Specifying Commits

Page 12: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes

● Hashing● Hooks● Bisect● Filter-branch● github pages

What should we cover?

Page 13: Week 8: Cherry Picking and Reflog Shannon Lee Alvin Wang …dogfalo.github.io/git-stuco/week8/Week 8.pdf · git cherry-pick  Like a mini rebase It applies the changes

Git internals

Next Week