Challenge - 5 Problems
Merge Commit Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of a successful merge commit?
You run
git merge feature-branch on your main branch. The merge completes without conflicts and creates a merge commit. What will git log --oneline -1 show as the commit message?Attempts:
2 left
💡 Hint
Think about the default message git uses when creating a merge commit.
✗ Incorrect
When git creates a merge commit, it automatically generates a commit message like "Merge branch 'feature-branch'" to indicate the source branch merged.
🧠 Conceptual
intermediate2:00remaining
What happens during a merge commit creation?
Which of the following best describes what a merge commit does in git?
Attempts:
2 left
💡 Hint
Think about how git tracks the relationship between branches after merging.
✗ Incorrect
A merge commit has two parent commits, linking the histories of both branches together without deleting or rewriting history.
🔀 Workflow
advanced2:00remaining
Identify the correct git commands to create a merge commit
You want to merge the branch
feature into main and create a merge commit even if the merge could be fast-forwarded. Which sequence of commands will do this?Attempts:
2 left
💡 Hint
Remember to be on the target branch before merging and use the option to force a merge commit.
✗ Incorrect
To create a merge commit even if fast-forward is possible, you must be on the target branch and use
--no-ff option with git merge.❓ Troubleshoot
advanced2:00remaining
Why does git refuse to create a merge commit?
You run
git merge feature on main, but git fast-forwards instead of creating a merge commit. You want a merge commit. What is the reason?Attempts:
2 left
💡 Hint
Think about when git chooses to fast-forward merges.
✗ Incorrect
If the target branch has no new commits since branching, git fast-forwards by default instead of creating a merge commit.
✅ Best Practice
expert2:00remaining
What is the best practice for merge commit messages?
When creating a merge commit manually, which message style is recommended to keep history clear and useful?
Attempts:
2 left
💡 Hint
Think about clarity and usefulness for future readers of the history.
✗ Incorrect
A good merge commit message includes the default merge info plus a short summary of changes for clarity.