Squash git commits when merging
source link: https://www.devroom.io/2016/08/17/squash-git-commits-when-merging/?utm_campaign=Feed%3A+ariejan+%28ariejan%7Cdevroom.io%29
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.
Squash git commits when merging
Posted:
2016-08-17
- Last updated:
2019-06-05
Tagged git
Today I’ve been fighting to get our test suite to run against a newly delivered Oracle 12 database. Of course, that didn’t work out of the box, so there was some debugging, trial-and-error, and cursing involved. Finally, I managed to get the build back up and running. Yay!
The commit history for this pull request was horrible and some would call it unprofessional, looking at the various commit messages written in anger.
Normally I’d squash all commits together using rebase in the feature
branch and create a nice pull request. In this case I just wanted to merge this to
develop
so the build was working. Turns out this is rather easy:
git checkout develop
git merge --squash fix_for_oracle_12
This applies all changes from the fix_for_oracle_12
branch to your working copy, ready
for you to commit in a single commit.
git commit -m "Apply workaround for Oracle DB 12"
Done.
My site is free of ads and trackers. I record privacy-respecting usage statistics with Fathom.
Was this post helpful to you? Why not ☕ Buy me a coffee
Copyright © 1999-2020 Ariejan de Vroom <[email protected]>
Live now; make now always the most precious time. Now will never come again.
– Jean-Luc Picard
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK