573 questions
4
votes
2
answers
79
views
Merging branch based off another branch that since has been merged (with squash and delete)
I am running into some weird merge conflict issues even though I am the only one working on the repository and have only made linear commits.
I have these branches:
main
feature-A (based off of main)
...
0
votes
1
answer
48
views
`git rebase --interactive` always use rebase-then-squash workflow and introduce many conflict resolution, how to switch to squash-then-rebase?
Here is a typical example of executing git rebase --interactive --autosquash:
git rebase --interactive --update-refs origin/master
Rebasing (1/102)
Rebasing (2/102)
error: could not apply eff00df3... ...
0
votes
1
answer
120
views
What does `git diff` actually compare during a rebase conflict?
I have recently learned that git diff --cached shows how the new commit during an interactive rebase conflict after resolving the conflict looks. What does git diff compare during resolving a git ...
0
votes
4
answers
113
views
Squash a single conflict fixing incorrect merge conflict resolution into merge commit
This is a scenario I've run into multiple times: suppose you have a feature branch, and you then need to merge in the develop branch and resolve conflicts prior to your PR being merged. You merge ...
3
votes
1
answer
107
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
231
views
How to drop changes to submodule ref from commit during rebase
I'm rebasing my branch on origin/master using
git pull --rebase origin master
Now I get some merge conflicts regarding git submodule updates:
diff --cc cpp_lib
index c14a3fe5,71b17a71..00000000
--- a/...
-1
votes
2
answers
92
views
git rebase --rebase-merges produces merge conflicts
I have a git repository that has two branches with unrelated history like this
A'
A - B - [...] - C
where the [...]-part is complicated (non-linear and many commits). Both the commits A and A' are ...
2
votes
2
answers
92
views
How to better merge changes in git when a module was split into two smaller files?
I got sick of a python god module and broke it up into two smaller modules, there was limited refactoring beyond pulling functions/objects out and putting them into files that made more logical sense. ...
4
votes
1
answer
82
views
Is it possible to identify merge commits that had conflicts after the fact?
I am trying to collect a dataset of merge conflicts based on programmatic command line interactions. The program should run in the terminal, I am fine with using external tools as long as they are ...
2
votes
1
answer
96
views
Git get theirs commit hash
When git working tree is in conflict state during merge/rebase/cherry-pick, it's possible to get ours/theirs/base version of individual files by several ways, e.g. git checkout --ours/--theirs path/...
-1
votes
1
answer
105
views
Merging master into feature branch with conflict resolution
Let's say I have a feature_branch that is based on master and contains commits D and E. Afterward, master receives two new commits, F and G :
master: A---B---C---F---G
\
...
0
votes
1
answer
132
views
git merge conflict - common ancestor too old
We use Azure devops for development, there are 2 branches: stable and release.
When do development we create feature branch from release and create PR to merge it back to release (by default sqush ...
0
votes
1
answer
153
views
Git merge does not take all files from source branch
I have two branches, 'master' and 'develop'.
Other branches have been merged into 'master'.
Now, when I merge 'master' into 'develop', some files from 'master' are not carried over into 'develop'.
How ...
0
votes
1
answer
72
views
Git squash old commits
I have a git log like this
* cb0bfd5 (HEAD -> feat/nuxt, fork/feat/nuxt) Split into icons
* f2d2410 fix: buttons spaces & move layouts to components (#3)
* 881d4ab Split into Components, ...
0
votes
1
answer
214
views
How to make a Git custom merge driver automatically stage resolved files?
I've been trying to set up a custom merge driver for merge conflicts in Git and have it mostly working, but can't figure out why it doesn't automatically stage successfully-resolved conflicts like the ...
5
votes
1
answer
98
views
Can I write a specific rule about how git should handle a specific commonly occurring merge conflict in a specific file?
I have an Obsidian vault under version control, and one of the plugins synchronises with an external source, updating a timestamp in the config file.
I switch between two separate user accounts for ...
1
vote
1
answer
775
views
Unexpected Git incoming/outgoing conflict in Visual Studio Code
I develop an app using Visual Studio Code on my computer, and I use the Source Control function to sync the code on a GitHub account.
I've never had any issue using the basic functions: I commit my ...
0
votes
0
answers
49
views
Is there a git merge strategy which can resolve next merge conflict?
TLDR;
On master branch the discourse section was removed
On dev branch the fddkim section was removed
dev branch is being rebased on top of master
A merge conflict happened
I am looking for an ...
1
vote
0
answers
47
views
Bizarre behavior when I amend a commit [duplicate]
I hope someone can tell me what Git is doing to me.
First, a caution: the stuff in this repo is totally proprietary.
I doubt that I could sanitize it without changing it so much that the problem goes ...
1
vote
0
answers
196
views
Git merge strategies vs. merge drivers vs. mergetools
Both Stack Overflow answers, and various webpages, give contradictory or conflicting definitions of "merge strategy", "merge driver", and "mergetool".
Here is my best ...
0
votes
1
answer
156
views
Git cant create pull request | different commit histories | bfg --delete-files | git merge --allow-unrelated-histories
For the past year we've been working with a staging and master branches, testing our changes before merging to master.Now when trying to pull request from staging to master I'm facing an error message ...
1
vote
1
answer
216
views
How can I fix a merge conflict from the Github website?
I was on a branch called make-monolith-ids-constant.
I ran these commands in the terminal.
git checkout make-monolith-ids-constant
git fetch origin master
git rebase origin/master
I now have a merge ...
0
votes
1
answer
136
views
Git Conflict Resolution Challenge: How to restore last saved code after conflicts
I am encountering challenges in resolving conflicts in my React Native project using GitHub Desktop and VSCode. I worked in a branch fonts-and-colors that is forked from main. I was going to commit ...
0
votes
2
answers
244
views
How to resolve git conflict locally (with some constraints)?
I want to resolve a git merge conflict (between feature and test branches), but there are some limitations:
cannot push directly to test and master branches
cannot merge feature branch into the test ...
2
votes
1
answer
329
views
git reports merge conflict although files are the same
I have a master branch and development/Server branch in git.
I created Pull Request and trying to merge development/Server to master branch but I am facing conflict.
I am getting conflicts for 2 files:...