Pull Request /PR (Create n Complete by Squash Merge) Git

CREATE A NEW PR (See Create PR)

  • Release Branch has 18 commits
  • featureone Branch has 4 commits

 

 

This time add a Reviewer, Work item for this commits & Tag name for PR

No Conflicts

Reviewer, Tag and Work Item all are showing on right 

 

 

 

 

 

Complete the PR - Using Squash MERGE TYPE
Step 1: Approve your PR

 

Step 2: Complete your PR

  • in devOps > Go to that Merge
  • Use Case for Squash Merge
    • Suppose a developer was creating. About 100 commits have been made to his local repository. He submitted 100 commits to his remote branch. 
    • The developer manager tells the developer to push all changes to a development branch. 
    • A condition exists. He believes you have hundreds of unnecessary commitments. My developer branch does not need those histories.  Push all your source code, but not your history.
  • How Possible
    • The developer will use squash commit then. So what about squash? 
    • One commit will contain all 100 commits. That way, what happens? History will vanish. Zero history. You cannot reverse the developer's work, but you will have a clearer past. source code. Squash is about that.
    • Each pull request becomes a single commit with no merge, just a state. A linear history. The squash graph is simple.
  • Complete option show Merge Type in drop down -SELECT Squash Merge

 

 

Result

  • we have a linear graph.
  • featureone Branch still has 4 commits
  • Release branch now have on additional commit - 15 its own and 1 of this PR

Related Question