R
R
Roman Basharin2017-04-13 00:42:35
git
Roman Basharin, 2017-04-13 00:42:35

Git how to exclude commits from history when merging into master branch?

Greetings colleagues. Perhaps the question is obvious, but I did not find an obvious answer. Suppose we have a master branch in which each commit is the release of a new version / sub-version of the application. If I want to add a new feature, I copy the master branch, and the new branch can have a bunch of commits. Further, when merging, this heap is included in the main branch. How to avoid it? (if you know how to do it in SourceTree, generally cool). Good to you!))
As needed:
v 2.0.0
v 1.1.0
v 1.0.0
As it is now:
v 2.0.0
... (there are 20 commits to upgrade to the new version)
v 1.1.0
fix
API almost completed, cover tests the main class
to complete the styles
v 1.0.0
UPD:
- In short, read @fshp's answer
- For more details, read the comments in the next solution

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Moseychuk, 2017-04-13
@Hellek

You need the squash option.
And if for small branches of a dozen lines this can be justified, then in other cases the head is off your shoulders for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question