Answer the question
In order to leave comments, you need to log in
How to merge branches without saving commit history?
There is a local repository with two branches master and dev. Master has one "init" commit, dev has the current state.
Once I'm done developing, I'll create a remote repository and add it. I used a fast-forward merge, but the commit history is preserved and the dev branch is deleted.
I need to save the history of the dev branch, but when merging, do not transfer the history of the branch to master
Answer the question
In order to leave comments, you need to log in
git checkout master
git merge --squash dev
git commit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question