Questions tagged [squash]

Term used in version control systems that means combining several commits into one. Most often seen with git.

See Git - Tools - Rewriting History: squashing.

286 questions
3
votes
2 answers

Git commit template does not show up when I squash N-commits

I have setup path to the template file on my config file, and it works fine when I do basic commit (git add -A . && git commit): [commit] template = .git-commit-template.txt Instead when I try to squash N-commits, and also add their…
alper
  • 2,919
  • 9
  • 53
  • 102
3
votes
1 answer

Rebase "fixup" commit into prior merge commit

I have performed the following merge: A---B---C---E (HEAD, merge of C and D) / D---| But I noticed some issues in E, and fixed them in F: A---B---C---E---F (HEAD) / D---| I want to modify commit E so that it…
Craig Otis
  • 31,257
  • 32
  • 136
  • 234
3
votes
2 answers

"Amend" a git merge commit after the merged branch is changed

Suppose that I have merged a source branch to a destination branch in git. It took a lot of time to resolve the conflicts. In the meanwhile the source branch has changed a lot. Now I have to merge the latest state of the source branch into the…
szali
  • 498
  • 3
  • 11
3
votes
1 answer

How to make sure fixup commits are not merged into master branch

I use git commit --fixup (or --squash) a lot, especially during code reviews. Obviously these commits should eventually disappear after a git rebase --autosquash but it worries me that I might forget to rebase and merge these commits into…
3
votes
2 answers

Squash commits on GitHub PR

I have made 6 commits on a GitHub branch completely online and I need to squash them into 1 commit. Is there a button for me to do this? I've only made the commits on the GitHub website so is there a way to do this without using the command line?
Erika
  • 235
  • 4
  • 12
3
votes
1 answer

Squash every commits older than 1 year in a very huge repository and limited resource

I have a 4 years old git repository that starts to become really huge: ~30GO, 60.000 files. One or two commit are done each day. I would like to squash every commits older than 1 year into the first commit. But because of technical issues, I…
djoproject
  • 136
  • 8
3
votes
3 answers

Is it safe to squash commits from other branch

There are two branches master and feature. The development goes in feature branch and there multiple commits done in that branch, but in between them there were several merges with master branch, so the log for feature branch is for example…
marknorkin
  • 3,904
  • 10
  • 46
  • 82
3
votes
2 answers

How do I squash all commit history and push into another remote repository?

I have not been able to figure out after much trying. I have two local branches, master and tests. I have two corresponding remote branches with the same repo, origin/master, origin/tests. I have another remote branch public/master. I have some…
soham
  • 1,508
  • 6
  • 30
  • 47
3
votes
1 answer

How to squash commits in branches

I am importing an old svn repo into git. At one point a folder was renamed in all branches. This was done in svn by creating a duplicate with history, followed by a delete of the original on a second commit. So I have a repo that looks like…
3
votes
1 answer

Squash hundreds of old commits on origin

I made a silly mistake and am not sure the best way to resolve it. Here's what I did: Created a web project based on a boilerplate. Removed .git to remove all history (about 500 commits) before making my initial commit Several months and about 200…
Tauren
  • 26,795
  • 42
  • 131
  • 167
3
votes
1 answer

How to squash a commit made in the GitHub website?

I did a little editing in a file on my GitHub repository through the website and then committed the changes. It's not like changing a file, committing and then pushing it to the origin, I did it directly by going to the website. Now there are two…
3
votes
1 answer

Massive git commit squashing

My company is in the middle of converting from CVS over to git. We've been on CVS for a long time, so there is a huge history. Too much to do by hand. Looking at the logs, there is a lot of squashing that could be done. A whole lot. What I would…
Nycto
  • 1,670
  • 2
  • 14
  • 18
3
votes
2 answers

Squash all commits in branch in git

Say I have a number of commits in the feature branch from last commit in master ... - last_commit_in_master - C1 - C2 - .. - C100 Now I want to merge all those commits into a single one. I know one solution: git rebase -i master replace all the…
RiaD
  • 46,822
  • 11
  • 79
  • 123
3
votes
1 answer

How to squash all merges in a branch?

I have a branch like this: A---B---B1---B2---D---E---E1---E2---G---H \ / \ / C1---C2---’ F1---F2---’ I want to rewrite it and make it like this: A---B---B1---B2---D---E---E1---E2---G---H That means,…
Lavir the Whiolet
  • 1,006
  • 9
  • 18
3
votes
3 answers

How to automatically squash git repository history, without conflicts, in order to shrink it?

I have a repository that has grown too big to the point it has become unusable. Basically my repository is over 2GB and takes too long to clone. I now want to shrink it, but still be able to go back to some specific old versions... Shrinking will…
Asmodehn
  • 41
  • 5