K
K
Kit Scribe2020-03-06 21:01:00
git
Kit Scribe, 2020-03-06 21:01:00

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

1 answer(s)
D
Dmitry Shitskov, 2020-03-06
@kitscribe

git checkout master
git merge --squash dev
git commit

https://ru.stackoverflow.com/a/434008

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question