1

When working on a project I like to do git -a -m 'part' commits to commit partial implementations. These implementations are not working but it is useful to have them to be able to go back if in next step something messes up.

After doing it there are several commits on a branch on a local repo. When pushing this branch to remote repo with git push all commits are added.

So on a list of commits all the partial commits are seen.

But they are unnecessary on remote repo. They wont work and spam the remote repo.

I would like to have only the final commit (with all changes so far in partial commits) on remote repo in one commit.

How to acomplish it?

Tom Smykowski
  • 25,487
  • 54
  • 159
  • 236
  • If you can do it, you must modify the commit list and this is not recommended if you are working on a multi-member project. – Nicolás Alarcón Rapela Mar 14 '18 at 10:28
  • 1
    Possible duplicate of [Squash my last X commits together using Git](https://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git) – Andrejs Cainikovs Mar 14 '18 at 10:29
  • Use squash via interactive rebase - check the link above. If your commits are local, of course. Once you pushed to remote, the only thing you can do is to rewrite the history, which is highly not recommended. – Andrejs Cainikovs Mar 14 '18 at 10:39

0 Answers0