Sep
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>

    ? Step 2: Stash Your Changes

    • 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>

        ? Step 3: Switch to Target Branch

        • Go to Git Repository Window (or Team Explorer ? Branches).
        • Double-click the branch you want to move changes to.
        • /ul>

          ? Step 4: Apply the Stash

          • Back in Git Changes, click the ellipsis (…) menu again.
          • Select Stashes.
          • Find your stash and click Apply.
          • /ul>

            ? Step 5: Stage Only What You Want

            • 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>

              ? Step 6: Commit

              • Once you’ve staged the desired changes, click Commit Staged.
              • /ul>


An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.