D
D
Danil Antoshkin2015-07-15 08:37:53
git
Danil Antoshkin, 2015-07-15 08:37:53

How to remove commits from a branch?

Hello, I have such a problem, I want to use Git-Flow, but here I already have commits in master and I need to delete them and leave only the very first one.
How can I do that ?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
J
jcmvbkbc, 2015-07-15
@jcmvbkbc

git reset --hard <first commit id>

A
aol-nnov, 2015-07-15
@aol-nnov

"Remove" - ​​from the word "absolutely", or just hide changes inside other commits?
It is necessary to look towards interactive rebase.

A
Anton, 2015-07-15
@MoonMaster

Daniel read a better book about Git Pro Git there you will find answers to all your questions

S
Stanislav Makarov, 2015-07-15
@Nipheris

https://help.github.com/articles/about-git-rebase/
https://git-scm.com/book/en/v2/Git-Tools-Rewriting...
This is if you want to remove commits from history . If the history needs to be left, and just go to the state of the first commit, then see the answer jcmvbkbc

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question