The default github squash merge is poorly formatted and pretty ugly. The following commits will be squashed under the default commit message and look like this:īut if you use it… don’t forget to edit the message! The squash option on the Github UI will allow you to change default commit message which will be. Instead of adding commits 3 and 4 with commit Merge branch feature-branch, we are combining 3 and 4 and the resulting combined commit is 3(squashed)(I explicitly named it 3(squashed), you can name it whatever you like!). This may seem similar to Merge pullĪs mentioned, Merge pull request is simply adding the feature-branch commits with commit 52906c3 Merge branch feature-branch and is using it as a reference to the PR with both of the feature-branch commits. Request and squash it into a single commit.
Squashing works much like rebasing a branch, you can take a 5 commit pull You can also modify this in your repository settings. While this does merge in the PR into the master branch, the resulting git message isn’t very helpful when grepping through git commit messages to figure out what exactly changed when we merged the feature-branch.Īt Rietta, we have disabled the default “Merge pull request” in favor of ether squash merging or rebasing pull requests. The hyperlink provided by the message will take you back to the original PR with commits 3 and 4. This will be the new HEAD.Ĭommit Merge branch feature-branch on the repo Git history will look like Merge branch feature-branch. When using Merge pull request, (assuming that nothing has been merged into master previously) commits 3 and 4 will be added to the master branch as a commit, which we will call Merge branch feature-branch. After doing some work, we’ll have 2 additional commits Three and Four in which we want to merge into master. To work on a new feature, we’ll branch off of master branch and create a new branch called feature-branch. So for example, we have a base master branch with an initial commit and 2 new commits, the new commits are One and Two. The default option Merge pull request on Github will take all commits from the pull request and add them to the master branch with a new commit in a merge commit.
We can apply this way of thinking when we want to keep the master branch Git history clean and helpful to future you and other developers who may be combing through the history to figure out why the code structure is the way it is. Merging with a merge commit, squash merging, and “Rebase & Merge” should be pretty familiar as these are commands that are already commonly used when working on dev branches to keep commits on PRs tidy. GitHub provides three options when merging in commits, these three options being: This will improve performance and reduce the number of crashes, according to GitHub.Keeping a clean git history can save a lot of time when trying to track down commits related to a bug or issue that is disrupting dev efforts.
This release also introduces native support for Apple M1 Silicon. This enables developers to view the state of a repository at a previous point in time without impacting the branch currently being worked on. GitHub Desktop 2.9 also features the ability to start a new branch from an earlier commit.
This is intended for small changes, as there is already an existing undo feature in GitHub Desktop that reverts things back to the previous commit.
The next new feature in GitHub Desktop 2.9 is the ability to make changes to or update the commit message of the previous commit. In addition, developers will now be able to drag commits in the history to reorder them. When merging, they will be able to squash and rebase as part of the merge. Now, developers will be able to drag commits on top of each other to squash them together and add a new commit message to that grouping. New features include the ability to squash and reorder commits, amend previous commits, and start new branches from earlier commits.Īccording to GitHub, commit history is often used by developers to tell a story about the progression of a project. GitHub has announced the release of GitHub Desktop 2.9.