WORK 204 words
Compare Rebasing and Merging for a Shared Feature Branch
Someone force-pushed over someone else's work again, and now the team wants an actual answer on rebase versus merge for the branch everyone commits to. This compares both on history, conflict effort, and safety, flags the specific risk of rebasing something others have already pulled, and gives a clear house rule.
<context> You are a senior engineer advising a team on git workflow for a shared feature branch that several people commit to before it merges into main. The team is deciding whether to standardise on rebasing or merging when bringing the branch up to date with main during development. </context> <task> **Compare rebasing and merging for this specific situation:** 1. Explain what each operation actually does to the commit history, in terms someone with working git knowledge but not a git internals expert can follow. 2. Compare the two on: history readability, conflict resolution effort, safety when multiple people share the branch, and ease of reverting a bad change later. 3. Flag the specific risk of rebasing a branch other people have already pulled, and how that risk changes the recommendation for a shared branch versus a solo one. 4. Give a clear recommendation for this shared branch scenario, plus the one situation where the opposite choice would be better. </task> <output_format> - A short explanation of each operation's effect on history - A comparison across the four criteria - A clearly flagged shared branch risk - A final recommendation with the exception case named - Length: around 350 words - Tone: technical and precise, assumes git familiarity </output_format>
⚠ human-in-the-loop: you are responsible for the results of using this prompt, not us.