Work-in-progress commits are helpful when working on a feature branch, but they aren’t necessarily important to retain in the Git history. You can use squash and merge to create a more streamlined Git history in your repository. To squash and merge pull requests, you must have write permissions in the repository, and the repository must allow squash merging. Pull requests with squashed commits are merged using the fast-forward option. Instead of seeing all of a contributor's individual commits from a topic branch, the commits are combined into one commit and merged into the default branch. When you select the Squash and merge option on a pull request on, the pull request's commits are squashed into a single commit. For more information, see " About protected branches." Squashing your merge commits You can prevent anyone from pushing merge commits to a protected branch by enforcing a linear commit history. ![]() The default merge method creates a merge commit. To merge pull requests, you must have write permissions in the repository. The pull request is merged using the -no-ff option. When you click the default Merge pull request option on a pull request on, all commits from the feature branch are added to the base branch in a merge commit. ![]() For information about merge queue, see " Managing a merge queue." Note: When using the merge queue, you no longer get to choose the merge method, as this is controlled by the queue.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |