What happens if I use a squash instead of a true merge when performing one of th...
source link: https://devblogs.microsoft.com/oldnewthing/20210706-00/?p=105406
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
What happens if I use a squash instead of a true merge when performing one of the git tricks?
Raymond
July 6th, 2021
A customer wanted to know which of the git tricks I’ve shared still work if you use a squash instead of a true merge. For example, in the case of splitting a file in two while preserving line history, can this be done with squashing?
Many of the git tricks exploit the way git walks the commit graph, and squashing creates a different graph from merging. Specifically, squashing throws away all our hard work in building a specific commit graph. Instead, squashing takes all the changes and squashes them together into a single commit. It’s as if you made all the changes at one sitting and committed them as a unit.
On the other hand, squashing works just fine with the tricks that involve a single non-merge commit. It just replaces one non-merge commit with an identical one.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK