J
J
Jekson2020-08-25 12:49:57
git
Jekson, 2020-08-25 12:49:57

How to merge the last 2 commits?

I pushed the changes to the server, after that I saw that I forgot to add something, made changes on the LAN and pushed it again. Now there are 2 separate commits on the server for one task. How to combine them into one?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Pugachev, 2020-08-25
@Lepilov

git reset --soft HEAD~2
git commit -a -m 'join'
git push origin <branch>  --force

more or less like this

J
Jekson, 2020-08-25
@Lepilov

wiki.rosalab.ru/ru/index.php/%D0%91%D0%BB%D0%BE%D0...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question