Answer the question
In order to leave comments, you need to log in
Is it possible to merge only the last commit from dev to master?
Sobtvenno it seems like everything is clear ... There is a virgin branch to a pile of garbage. I want to commit to the master what is currently available as a new commit. Is that possible?
Answer the question
In order to leave comments, you need to log in
You can only merge the last commit, you can’t do without the previous ones, but you can do a cherry-pick if I understand the question correctly.
git rebase -i
In the editor that opens, put s (squash) on all commits except one and they will all be merged into one.
In general, forget about rewriting history. Everything that was done in the same form and should remain. The beauty of the commit tree is of no use to anyone, but the blame on the desired construction site after you rewrite the history will already point not to the real commit in which the edit was made, but to the commit in which you rewrote the history. Rebase is a bad thing. Merge our everything. And most importantly, simple and clear.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question