Linked Questions

5792 votes
47 answers
4.7m views

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

I'm on the master branch and in hindsight, I have pushed too many commit messages (or at least my teammates tell me so). Here's what the log looks like: % git log --oneline fc71bc8 (HEAD -> ...
Gaurav Bansal's user avatar
0 votes
1 answer
536 views

I am very new to manipulating anything in git, but I have a bunch of commits that I want to combine into one commit (7 commits of me deleting one file at a time). I have made more commits since then ...
Bubinga's user avatar
  • 713
0 votes
0 answers
59 views

I made the mistake of making too many small commits after committing big changes and then realizing I missed something minor when comparing changes to master in a pull request. How could I go about ...
Kaisermania's user avatar
0 votes
0 answers
26 views

I would like to squash all commits between 2 commit id's. Commit id 08f68388387e81aaff8e8cdfa619b6c23adef39d is the first commit I made on the branch, and I would like to squash all commits till and ...
Peter Boomsma's user avatar
1959 votes
15 answers
1.2m views

I have a remote Git server, here is the scenario which I want to perform: For each bug/feature I create a different Git branch I keep on committing my code in that Git branch with un-official Git ...
SunnyShah's user avatar
  • 30.6k
1403 votes
15 answers
1.2m views

I am trying to merge 2 commits into 1, so I followed “squashing commits with rebase” from git ready. I ran git rebase --interactive HEAD~2 In the resulting editor, I change pick to ...
michael's user avatar
  • 111k
188 votes
8 answers
223k views

This question pertains not only to how to accomplish this task, but to whether doing so is good or bad practice with Git. Consider that locally I do most work on the main branch, but I have created a ...
Todd Hopkinson's user avatar
110 votes
4 answers
191k views

I made a pull request on GitHub. Now the owner of the repository is saying to squash all the commits into one. When I type git rebase -i Notepad opens with the following content: noop # Rebase ...
omerjerk's user avatar
  • 4,319
58 votes
1 answer
22k views

I want to squash several commits together in the middle of a branch without modifying the commits before and after. I have : A -- B -- C -- D -- E -- F -- G | | master ...
deadbeef's user avatar
  • 5,583
9 votes
3 answers
12k views

Let's say my local git log shows: 739b36d3a314483a2d4a14268612cd955c6af9fb a ... c42fff47a257b72ab3fabaa0bcc2be9cd50d5c89 x c4149ba120b30955a9285ed721b795cd2b82dd65 y ...
theanine's user avatar
  • 1,018
24 votes
1 answer
4k views

I have a brand new git repo. It has three commits. I'd like to squash them together so my project history looks clean, and others don't see my hacky commits. Obviously nobody else has seen the repo,...
mikemaccana's user avatar
10 votes
3 answers
6k views

I am using git subtree to organize my git repositories. Let's say I have a main repository called repo and a library called lib. I successfully "imported" the lib repository by squashing its history. ...
ibizaman's user avatar
  • 3,413
3 votes
4 answers
4k views

Combining multiple commits before pushing in Git Based on my understanding, if I use git rebase -i master, then later I still need to git push origin master to upload the changes. Question> What is ...
q0987's user avatar
  • 36.2k
7 votes
2 answers
2k views

I pulled the last version from the online repository git pull origin master Then made some changes in the code-base and added them git add . Then created a new commit git commit -m "bug x fixed" Then ...
Martin AJ's user avatar
  • 6,825

15 30 50 per page