Skip to main content

Questions tagged [git-squash]

git squash is the command used to rewrite git history before it is pushed to the remote.

15 votes
1 answer
4k views

Git squash commits of renamed files (an keep history)

Backround Hi, I'm working on a local feature branch. This local branch is messed up with lots of small commits. Before pushing the branch to the remote I would like to tidy things up. For this I'd ...
RamNow's user avatar
  • 486
28 votes
8 answers
16k views

Git - squash entire branch - one line squash command

Whilst I am working on new code, I make many small commits to track my changes. My company, however, prefers each feature to be committed as a single commit. So the solution is to squash my entire (...
troymass's user avatar
  • 1,042
6 votes
2 answers
2k views

Compare branches after git merge with --squash

I have a parent branch A with a child branch B. In branch B i have two separate commits. I merged branch B in A with squash like this git merge --squash B When i compare branch A with branch B: ...
Arif's user avatar
  • 1,399
3 votes
1 answer
1k views

Merge + Squash does not change MERGE_HEAD?

We are working in a team where we had local branches with everyone working their own branch and we had committed few branches and merged with --squash. Now we have to delete those branches that are ...
Raza Hussain's user avatar
0 votes
1 answer
49 views

Git delete past commits from the tree as well as working directory

Currently, my git tree looks like this master ^ | Commit 3 ^ | Commit 2 ...
trailblazer's user avatar
  • 1,431
0 votes
2 answers
2k views

Github repo squash commits on master

I'm working with a github repo where a lot of commits historically have been "bugfix", "bugfix for real this time", "ok final bugfix", "finally fixed". These were committed directly to master. How ...
Don P's user avatar
  • 62.5k
0 votes
1 answer
271 views

How to merge two incontinuous commits

I want to merge e5c1e1d and 627c6c6 How to do it ? I want an easier way. Because if there are hundreds commits between them, it will be very trouble to do rollback then re-commit. * fc60bec - (HEAD,...
newBike's user avatar
  • 14.9k
1 vote
3 answers
1k views

Combining non-linear commits into one commit (sausage making)

Consider the following git history: * 21f05f9 - Fifth commit * 0534049 - Fourth commit * 738ae0a - Third commit * 288ffd2 - Second commit * 2535dca - First commit How would I combine 21f05f9 738ae0a ...
Fillip Peyton's user avatar
0 votes
1 answer
342 views

How do I fix this git commit log?

I have a repository on Bitbucket. I kinda screwed up the commit log when I tried to squash the commits c265825 and 0a1837e: Trying to squash these commits resulted in 0942142, which is basically ...
Big McLargeHuge's user avatar
55 votes
2 answers
36k views

git merge squash and recurring conflicts

I have a git repository with master and alt branches. alt branch contains modified version of master code, and i am trying to merge changes from master to alt like this: git merge --squash master ...
draganHR's user avatar
  • 2,807
58 votes
3 answers
42k views

Git rebase (Merge Squash) my feature branch onto another branch

I'm looking for a git command to help me with my feature branches when they're ready to go into Master. This git command would squash all my changes on my branch into a single commit on top of master. ...
John Hinnegan's user avatar
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
1893 votes
15 answers
1.1m views

How can I merge multiple commits onto another branch as a single squashed commit?

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
  • 29.9k
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
182 votes
8 answers
109k views

How do you squash commits into one patch with git format-patch?

I've got eight commits on a branch that I'd like to email to some people who aren't git enlightened, yet. So far, everything I do either gives me 8 patch files, or starts giving me patch files for ...
skiphoppy's user avatar
  • 101k

15 30 50 per page
1
11 12 13 14
15