Linked Questions

5512 votes
46 answers
4.0m views

How do I squash my last N commits together?

How do I squash my last N commits together into one commit?
markdorison's user avatar
2 votes
1 answer
236 views

how do you git push only the new commit [duplicate]

Because Git is distributed, and committers can commit within their own repositories, they can make a series of commits, then git squash the series of commits to make a new commit, then git push ...
american-ninja-warrior's user avatar
1 vote
0 answers
23 views

git squash forked repo commits [duplicate]

Here is the situation where I need help to do squashing. I've forked as repository. Say MAIN is the main repository and FORK is the forked repository. I did my developments on 'develop' branch in ...
zeroweb's user avatar
  • 2,682
512 votes
8 answers
395k views

Combining multiple commits before pushing in Git [duplicate]

I have a bunch of commits on my local repository which are thematically similar. I'd like to combine them into a single commit before pushing up to a remote. How do I do it? I think rebase does this, ...
muudscope's user avatar
  • 6,980
673 votes
5 answers
202k views

How to update a pull request from forked repo?

So I first forked a repo and then made a commit to that forked repo. I then opened a pull request. The pull request listed all the changes I wanted. After reviewing my pull request, there were a ...
stevebot's user avatar
  • 23.8k
46 votes
5 answers
19k views

Squash to only one "proper" commit for github pull request

I have a repo on github which someone else (Bob, for the sake of argument) has issued a pull request for. His code's not perfect, so we go through a few rounds of markups. As I understand it, he ...
Chowlett's user avatar
  • 46.4k
13 votes
4 answers
40k views

How to Squash 3 commits into 1?

I'm fairly new to git, so I've been trying to figure out how to squash 3 commits into 1 so my PR can get merged. I've read a lot of docs and guides and sort of found out how to squash commits but one ...
Kaycee's user avatar
  • 133
4 votes
1 answer
6k views

git rebase: "Could not apply (hash)." I'm lost

I've been asked to "rebase and squash (my) commits into a single commit?" for a pull request https://github.com/samtools/htsjdk/pull/34#issuecomment-45226559 It's the first time I'm doing this and I ...
Pierre's user avatar
  • 35k
4 votes
1 answer
7k views

Squash GitHub commit online

I have made my first contribute to a project on GitHub. I have selected the file to edit, created a pull request, and made my edits. Then I noticed a mistake, selected the file again, and made my ...
Andrea's user avatar
  • 745
2 votes
1 answer
453 views

Git rebase and squash on branch that has merges from master?

I have a feature branch that I've been working on for some time in parallell with master. During this time, after making some changes directly to master, I've merged those changes into my feature ...
Magnus's user avatar
  • 18.2k