0
0
Gitdevops~10 mins

Golden rule of rebasing (never rebase public) in Git - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to start an interactive rebase of the last 3 commits.

Git
git rebase -i HEAD~[1]
Drag options to blanks, or click blank then click option'
A2
B4
C3
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number too small or too large for the intended commits.
Forgetting the -i flag for interactive rebase.
2fill in blank
medium

Complete the sentence: You should never rebase commits that have been {{BLANK_1}}.

Git
You should never rebase commits that have been [1].
Drag options to blanks, or click blank then click option'
Apushed
Bcreated
Cstaged
Dmerged
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'merged' or 'created' which are not the key issue.
Confusing staging with pushing.
3fill in blank
hard

Fix the error in the command to rebase the current branch onto main.

Git
git rebase [1]
Drag options to blanks, or click blank then click option'
Aorigin/main
Bmain
CHEAD
Dmaster
Attempts:
3 left
💡 Hint
Common Mistakes
Using origin/main can cause confusion or errors.
Using HEAD does not specify the target branch.
4fill in blank
hard

Fill both blanks to complete the advice: Never rebase {{BLANK_1}} branches that have been {{BLANK_2}} to a shared repository.

Git
Never rebase [1] branches that have been [2] to a shared repository.
Drag options to blanks, or click blank then click option'
Apublic
Bpushed
Cprivate
Dcreated
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up 'private' and 'public'.
Using 'created' instead of 'pushed'.
5fill in blank
hard

Fill all three blanks to complete the command that safely updates your feature branch with main without rebasing public commits.

Git
git checkout [1] && git fetch origin && git merge origin/[2] && git push origin [3]
Drag options to blanks, or click blank then click option'
Afeature
Bmain
Ddevelop
Attempts:
3 left
💡 Hint
Common Mistakes
Using rebase instead of merge on public branches.
Pushing the wrong branch name.