Questions tagged [git-squash]
git squash is the command used to rewrite git history before it is pushed to the remote.
git-squash
225
questions
0
votes
0
answers
18
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 ...
-1
votes
2
answers
87
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 ...
0
votes
1
answer
89
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 ...
1
vote
3
answers
315
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 (...
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 ...
0
votes
1
answer
48
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 ...
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
...
-1
votes
2
answers
432
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 ...
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 ...
0
votes
2
answers
134
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 ...
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
...
0
votes
2
answers
485
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" ...
3
votes
2
answers
96
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 ...
2
votes
1
answer
98
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 ...
0
votes
1
answer
162
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 ...