FlashKeepers

Git and Version Control · College · College and University

Git III: Rebase, Reset and History

Rebase, interactive rebase, cherry-pick, reset modes, revert, reflog, stash, bisect and amending commits.

About this set

40 basic cards for College Git and Version Control. Set 3 of 4 in Git. It opens with "What does git rebase do?" and "What command rebases your current branch onto another branch?". Study it alongside the other College sets below.

40 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What does git rebase do?
Show answerReapplies commits from one branch onto another branch, creating a linear history
What command rebases your current branch onto another branch?
Show answergit rebase <branch-name>
What happens to commit hashes during a rebase?
Show answerThey change because each commit is reapplied with a new parent commit
Why is rebasing already-pushed commits considered dangerous?
Show answerOthers may have based work on those commits, and rewriting history causes conflicts and confusion
How does git rebase differ from git merge in the resulting history?
Show answerRebase creates a linear history; merge preserves both branches and creates a merge commit
What is interactive rebase?
Show answerA way to interactively modify, reorder, or squash commits before rebasing onto another branch
What command starts an interactive rebase?
Show answergit rebase -i <commit> or git rebase --interactive <commit>
What does the pick action do in interactive rebase?
Show answerKeeps the commit and applies it to the new base unchanged
What does the reword action do in interactive rebase?
Show answerKeeps the commit but opens an editor to change its commit message
What does the squash action do in interactive rebase?
Show answerCombines a commit with the previous one and prompts you to merge both commit messages
What does the fixup action do in interactive rebase?
Show answerLike squash, but automatically discards the commit's message and keeps only the previous one
What is cherry-pick?
Show answerApplying a specific commit from one branch onto your current branch
What is the command to cherry-pick a single commit?
Show answergit cherry-pick <commit-hash>
Can you cherry-pick multiple commits at once?
Show answerYes, list multiple hashes separated by spaces: git cherry-pick <hash1> <hash2> <hash3>
What does git cherry-pick --continue do?
Show answerResumes the cherry-pick operation after you have manually resolved merge conflicts

25 more cards in the app

Study this set free