8
Breaking up Big Merge Requests
Let's say you've made a bunch of code changes and it overwhelms your less experienced developers. Here’s a step-by-step Visual Studio workflow with screenshots for moving uncommitted changes to another branch and staging only what you need:
? Step 1: Open Git Changes Window
- In Visual Studio, go to View ? Git Changes.
- You’ll see all your modified files listed under Changes. /ul>
- In the Git Changes window:
- Click the ellipsis (…) menu in the top-right.
- Select Stash ? Stash All.
- Give the stash a name (optional). /ul> /li>
- This saves your work and clears your working directory. /ul>
- Go to Git Repository Window (or Team Explorer ? Branches).
- Double-click the branch you want to move changes to. /ul>
- Back in Git Changes, click the ellipsis (…) menu again.
- Select Stashes.
- Find your stash and click Apply. /ul>
- In Git Changes, click on a file to open the diff view.
- Hover over the left margin of the diff and click the
+icon to stage individual lines or hunks. - This is Visual Studio’s partial staging feature. /ul>
- Once you’ve staged the desired changes, click Commit Staged. /ul>
? Step 3: Switch to Target Branch
? Step 4: Apply the Stash
? Step 5: Stage Only What You Want
? Step 6: Commit


