S
S
sorry_i_noob2019-07-18 14:50:45
git
sorry_i_noob, 2019-07-18 14:50:45

Is there any way to send a commit to a remote repository that does not have my intermediate commits, with the help of which I reached the last one?

Hello. I am developing an application. And it has not very good commit messages. But the last commit is fine with that. I want to push ONLY the latest commit to a remote repository. And intermediate - no (with the help of which I reached the last). Can this be done? And if so, how?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
tsarevfs, 2019-07-18
@tsarevfs

https://git-scm.com/book/en/v1/%D0%98%D0%BD%D1%81%...

S
SagePtr, 2019-07-18
@SagePtr

git merge --squash

L
lorc, 2019-07-23
@lorc

Depends on what you want to do. If you want to push only the changes from the last commit, then you need to do an interactive rebase or cherry-pick on the branch of the remote repository.
If you still want to send all the changes, but in the form of a single commit, then you need squash, as it was correctly recommended here. It can also be done through an interactive rebase.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question