0
0
Gitdevops~20 mins

Rerere for repeated conflict resolution in Git - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Rerere Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What does Git's rerere feature do?

Git has a feature called rerere. What is its main purpose?

AAutomatically merges branches without any conflicts.
BEncrypts commit messages to secure the repository history.
CAutomatically remembers how you resolved a conflict and reuses that resolution if the same conflict happens again.
DDeletes branches that have been merged to keep the repository clean.
Attempts:
2 left
💡 Hint

Think about how Git can help you avoid resolving the same conflict multiple times.

💻 Command Output
intermediate
2:00remaining
Output of enabling rerere and resolving conflicts

You run these commands in a Git repository:

git config --global rerere.enabled true
git merge feature-branch

The merge causes conflicts. After you fix the conflicts and run git add and git commit, what will happen if you later merge the same conflicting changes again?

AGit will automatically apply the previous conflict resolution without asking.
BGit will show the same conflicts again and require manual resolution.
CGit will abort the merge due to repeated conflicts.
DGit will delete the conflicting files.
Attempts:
2 left
💡 Hint

Think about what enabling rerere does after you resolve conflicts once.

Troubleshoot
advanced
2:00remaining
Why rerere might not reuse conflict resolutions?

You have rerere enabled, but Git does not reuse your previous conflict resolutions during a merge. What could be a reason?

AYou forgot to stage the resolved files with <code>git add</code> before committing.
BThe conflict content changed slightly, so Git cannot match it to the recorded resolution.
CYou have not enabled rerere with <code>git config rerere.enabled true</code>.
DGit rerere only works on merge commits, not rebase.
Attempts:
2 left
💡 Hint

Consider how rerere matches conflicts to recorded resolutions.

🔀 Workflow
advanced
2:00remaining
Correct workflow to use rerere during a rebase

You want to use rerere to help resolve repeated conflicts during a git rebase. Which sequence of commands correctly uses rerere?

AStart rebase, enable rerere, abort rebase, then restart rebase.
BStart rebase, resolve conflicts, commit manually, then enable rerere.
CEnable rerere, start rebase, resolve conflicts, run <code>git commit</code> directly without staging, then continue rebase.
DEnable rerere, start rebase, resolve conflicts, stage files with <code>git add</code>, then run <code>git rebase --continue</code>.
Attempts:
2 left
💡 Hint

Think about when to enable rerere and how to continue a rebase after conflicts.

Best Practice
expert
2:00remaining
Best practice for managing rerere data in a team

Your team uses rerere to handle repeated conflicts. What is the best practice regarding the rerere data directory (.git/rr-cache)?

ADo not commit or share the rerere data directory; each developer manages their own rerere cache locally.
BCommit the rerere data directory to the repository so everyone shares the same conflict resolutions.
CDelete the rerere data directory regularly to avoid conflicts.
DDisable rerere on all developer machines to prevent confusion.
Attempts:
2 left
💡 Hint

Consider how rerere data is stored and shared among team members.