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.

0 votes
0 answers
19 views

Git Showing Same Line Removed and Added after Merging Master into Feature Branch [duplicate]

After I merged from master, there were a few conflicts which I resolved, I am seeing various files having the same line deleted and added back in. I am not sure where this is coming from or how to ...
Samuel's user avatar
  • 31
-1 votes
2 answers
89 views

How to convert GitHub squash and merge commits to merge commits?

I have a personal project GitHub repository that used the squash and merge option for pull requests. How do I rewrite the Git history so that the pull requests used the merge commit option instead of ...
Jacob Guiang's user avatar
0 votes
1 answer
91 views

git thinks branch missing commits merged earlier

My team has recently transitioned to a GitHub Actions CI/CD workflow and we are encountering an issue that I'm uncertain how best to resolve. First, I'll describe our current branching strategy: We ...
NoxelNyx's user avatar
  • 997
1 vote
3 answers
372 views

How does git handle squash merge vs normal merge?

Let's say we have a Pull Request merging the commits from branch A into branch B, and we can perform the merge with normal merge and squash merge. And if we first perform the merge with squash merge (...
Jason Yu's user avatar
  • 2,022
1 vote
0 answers
59 views

My interactive rebase squash ends up with more commits instead of reducing them. What am I doing wrong?

I have a branch named myBranch, which I'm working on for a complex feature for a long time. After I finished my work and wanted to open a merge request, gitlab showed that 47 commits was done in my ...
uylmz's user avatar
  • 1,532
0 votes
1 answer
49 views

Change git history of PR merged long time ago from commit method to squash method

Hello to the community! As you can see in the diagram there is a commit (cm1) that includes a lot of binary files that was committed in a local branch. This commit was reverted at cm2 and at the final ...
Nebula's user avatar
  • 51
1 vote
0 answers
60 views

How to rebase old commits (squashed in target) as empty?

We have a setup with two repositories, dev repository and deploy repository (can't change that) with rebase-only merge strategy. Initially dev repo looked like this: main: A -> B -> C -> D ...
Virgileo's user avatar
-1 votes
2 answers
440 views

Unknown revision or path not in the working tree on git reset --soft

I want to squash all the commits till a particular commit-id in a branch. I tried using the command git reset --soft HEAD~223 The number 223 was generated as follows: I ran the command git rev-list ...
pensee's user avatar
  • 465
1 vote
1 answer
64 views

Git rebase branch onto squash merge

I did a mess with my features branches. What I had: master: A - B \ branch1: E - F \ branch2: G - H And then I squashed and merge ...
Chana Drori's user avatar
0 votes
2 answers
137 views

best git practice to avoid squash

I have been using squash with the steps below and I find it really time consuming and error prone git rebase upstream/develop git merge-base mylocaldev upstream/develop (this will display a commit ...
user3277841's user avatar
0 votes
1 answer
48 views

How to merge multiple commits onto another branch with multi (number of co developers) squashed commit?

Now there is a branch(branch1), three people P1 P2 P3 they develop together on branch1 with the comimit log P1 commit1 P2 commit2 P3 commit3 P3 commit4 P1 commit5 P2 commit6 ... P1 commit100 ...
moe_sakura's user avatar
0 votes
2 answers
497 views

squash hundreds of commits and rebase kicks off a large conflict resolution

I have a "long lived feature" branch that i have been working for last 2 months. It has 211 commits that i want to squash into single commit before this "long lived feature branch" ...
ASy_Dev's user avatar
  • 11
3 votes
2 answers
97 views

How can I merge all my local commit before rebase my local branch from the main?

When I work in a team and must push my local branch to the remote main, I rebase firstly my local branch to master with this simple command: git fetch && git rebase origin/main But when I do ...
okli's user avatar
  • 33
2 votes
1 answer
99 views

How to have one branch with full history and one branch with squashed history?

I have are requirement that the main branch has only one (potentially big) commit per issue ID. However, to confirm to the best practice of small commits, I also need to create and keep(!) multiple ...
Marco Eckstein's user avatar
0 votes
1 answer
166 views

Git squash N-consecutive commits in the middle of the branch history

Let's say I have several consecutive commits, we name them A0..A99 for simplicity, pushed by the same author to the main branch: these commits are not the last commits pushed to the main branch as ...
simone.tino's user avatar
  • 2,380
0 votes
0 answers
39 views

Can't fully squash commits

The commit Paises ISO 3166-1 all modify the same files and leave them in the same state. Is there any way to make it so there's only 1 commit Paises ISO 3166-1 on the blue line right before the ...
Daviid's user avatar
  • 1,489
2 votes
2 answers
159 views

Squashing first few dozens of git commits that contain merge commits

I have an existing repository that has root R, then a few dozens of commits including multiple merges, up to X, and then linear history up to Y. I'd like to squash everything from R to X into a single ...
Xilexio's user avatar
  • 1,228
2 votes
1 answer
685 views

Cannot squash merge in GitHub Desktop

When trying to squash merge 3 commits in GitHub Desktop, I was warned with the following error message: Unable to squash. Squashing replays all commits up to the last one required for the squash. A ...
Paris Geis's user avatar
0 votes
1 answer
669 views

squash commits in git and remove "ugly" merge message

I am trying to squash 2 commits and remove merge part, but have some problems. I have branch main and featureBranch. In my terminal I do: git checkout main git merge --squash featureBranch git push ...
Kratos's user avatar
  • 841
0 votes
0 answers
49 views

How to fetch changes from a forked repository which is a subtree

So I have an issue wherein I forked Repository A to create Repository B. Then I added Repository B into a subdirectory of Repository C via the subtree command as follows: git subtree add --prefix={...
user3684314's user avatar
0 votes
0 answers
42 views

Delete/Squash old commits while keeping the changes that they introduced [duplicate]

I'm trying to delete/squash a bunch of old commits that I don't want on my git history which were just made to put together code from multiple locations that were not using git (local folders from ...
Girog's user avatar
  • 1
1 vote
0 answers
12 views

Squashing commits not in series using git rebase [duplicate]

I have multiple commits done on a branch for a C project and would like to squash them into just two commits. Commit 1 - should have only the changes to the actual functionality source code Commit 2 - ...
Engineer999's user avatar
  • 3,873
1 vote
1 answer
515 views

Squash git commits by author [duplicate]

I have a repository to which several (3) authors contributed commits to the same branch of the repo. I want to merge it to the repository from which it was forked, but the admin of that repository ...
John's user avatar
  • 481
0 votes
1 answer
81 views

Git: remove some commits from a branch

Let's say I have, in a given working branch, a history of commits that looks like the below: commithash1 [task-a] lorem ipsum commithash2 [task-a] dolor sit amet commithash3 [task-b] consectetur ...
darksoulsong's user avatar
1 vote
3 answers
268 views

How to correct bug in merge - squash fix commit to merge commit

this should be probably very easy, but I am not able to solve it out. I introduced bug in the merge, and than I corrected it in additional commit. I would like to squash the "bug fix" commit ...
Jakub Znamenáček's user avatar
0 votes
1 answer
307 views

Squashing commits gone wrong [duplicate]

Say I have pushed two commits and I and try to squash them. Instead of doing git rebase -i HEAD~2 - I accidentally do git rebase -i HEAD~3 Here the 3rd last commit is from someone else but it would ...
R11G's user avatar
  • 1,940
0 votes
1 answer
77 views

Undo git commit message in 2 different branches (develop and feature) after git push

do not want to break anything in the master branch. I forked a develop branch through below commands git checkout develop git pull upstream develop # pull the updates locally based on the git push ...
Ahamed Kamal's user avatar
8 votes
1 answer
1k views

Branching from a feature branch and reconciling commits after main squash merge

I have the following situation: I've worked on a feature branch (called work1) to which I have an outstanding PR. While I wait for the PR to be approved, I want to start working on a new feature ...
Leonardo's user avatar
  • 1,703
0 votes
1 answer
132 views

How Can I git squash commit after PR completed?

In our projects, We use policy squash merge for merging and release our project when merge release branch to master branch. one of my co-worker use no fast-forward merge and put all develop's history ...
Alex's user avatar
  • 31
0 votes
1 answer
40 views

bash script that squashes commits with same name in a row

I want to create bash script that squashes commits with same name in a row. The user should be able to enter the commit number between which it will search for commit names and if it finds 2 similar ...
Haso Rosy's user avatar

15 30 50 per page
1
2 3 4 5
8