2,245 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
1
answer
91
views
Git rebase file content messed up
Environment:
Local machine: Linux 16.1
Repository member: Visual Studio 2022 (Win11)
Today I merged a team member’s PR into master. This member modified file B. After the PR, the master branch’s graph ...
0
votes
1
answer
111
views
Add commit to an already-merged branch
This is my project's log:
nubarke@linux0:~/CLionProjects/untitled$ git log --graph --all --oneline
* 3ee3af6 (HEAD -> master) Rename project to Hard Disk Drive Stress Test
* 36f6c14 Off-by-one ...
-1
votes
2
answers
136
views
Git fixup after a merge with upsteam
Scenario:
work... work... work... git commit -m "Step1"
work... work... work... git commit -m "Step2"
work... work... work... git commit -m "Step3"
git pull # merge a ...
kan's user avatar
- 29.2k
3
votes
3
answers
155
views
Can squash commits be done in both directions of the timestamp?
Say there is a squash of 3 commits into a single commit like so:
pick abc Jan 1 stuff
squash def Jan 2 stuff
squash ghi Jan 3 stuff
pick jkl Jan 4 stuff
pick mno Jan 5 stuff
In the above, my ...
3
votes
1
answer
117
views
When removing a file from history, what makes it still left in tree?
I have a private file that leaks into the repo, and I want to delete it. Here are the commits I suppose that it is first added:
git log --follow --diff-filter=A --find-renames=40% --pretty=reference --...
0
votes
1
answer
73
views
Rebasing on top of master: what if same commit exists already in master's history?
During development I noticed a bug in someone else's code. It was necessary for me to fix the bug to continue testing my feature, so I created a fixing commit on my branch, and then a new branch from ...
-2
votes
2
answers
62
views
How can I rebase a Git branch as though a file was never changed? [duplicate]
Let's say I have the following text file:
fruits.txt
apple
mango
pear
That's the state of the file as-is at the HEAD. The file was last altered 2 commits ago. Before that commit the file read:
...
-1
votes
1
answer
74
views
Keep branch structure during git rebase
Let's say I have the following tree:
A -- B -- C -- D -- E main
\
F -- G -- H featureA
\
I featureB
I'm working off ...
1
vote
1
answer
49
views
How to rebase a git branch that contains a merge commit *and* corresponding, previous branch-point
I am trying to interactively rebase commits from the branch tmp/20241220-rebase-source onto tmp/20241220-rebase-target.
The commits to rebase include a branching point and corresponding merge-commit (...
1
vote
0
answers
45
views
Rebase and Deployment in GH Actions
I have a deployment.yml workflow in my repository that looks like this:
name: Run deploy
on:
workflow_dispatch:
push:
branches:
- main
- staging
- dev
Nothing fancy, has ...
0
votes
3
answers
85
views
git merge changes after previous merge
I have worked on a branch, and successfully merged my changes. After that I did another commit and want to merge it as well. However when I create pull request, it offers to merge the whole branch and ...
1
vote
2
answers
141
views
How to get back my old branch after a failed git rebase [closed]
I have the following situation: I rebased the feature branch my-branch on master using
git rebase master
from my-branch.
However I'm not happy with the result (AFTER), so what I want is to get back ...
glades's user avatar
- 5,402
8
votes
1
answer
258
views
Git squash commits in middle of branch with child branches after that
I have the following repo:
A--B--C--D--E--F--G--H--I--J
\
K--L--M
main -> J
DEV -> M
I want to squash the commits between B and E so the repo looks like ...
1
vote
1
answer
96
views
How to squash every merge commit on a branch (like `git rebase --squash-merges` instead of `--rebase-merges`)?
I'm trying to reconcile a very large feature branch with hundreds of commits that multiple teams and agencies worked on for a long time period. Unfortunately due to corporate policy issues it wasn't ...
0
votes
2
answers
115
views
After merge to master, rebase with master giving conflicts for all files merged to master
Case
A new branch created for given requirement
Adding changes as per requirement in the branch and
Below commands executed every time we commit
git add .
git commit -m "comment" (...