572 questions
4
votes
3
answers
105
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
78
views
Is there a command to "accept both changes" and swap the order in VSCode?
I prefer to use the normal text editor (not the merge editor) to resolve merge conflicts in VSCode. Sometimes, I need to accept both changes, but want the new text from the "incoming" change ...
0
votes
1
answer
49
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... ...
1
vote
2
answers
114
views
Is there a better way to commit conflict resolution changes separately when doing a git rebase other than committing conflict markers? [closed]
I have a feature branch that I want to rebase on main with conflicts that need to be resolved. I want to resolve these conflicts in a separate commit to my original changes. My branch has two commits, ...
0
votes
1
answer
126
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
1
answer
238
views
GitHub Actions stuck: Expected - Waiting for status to be reported
GitHub Actions have stopped running. They are stuck with the message: "Expected - Waiting for status to be reported". Other messages on the pull request page are: "Checks awaiting ...
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 ...
1
vote
4
answers
114
views
Testing versions of code with shared portions
I am trying to understand what is the process for testing two versions of the code while making changes to common code that is identical across versions. I want to have branch-specific code that is ...
3
votes
1
answer
111
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
141
views
Merging with meld: hideResolved vs useAutoMerge
As far as I know, there are two options to make meld automatically merge the changes which do not conflict.
What is the difference between both options, and which is preferred?
git config --global ...
0
votes
1
answer
234
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/...
0
votes
4
answers
132
views
How to find all branches with merge conflicts?
I know various ways to list git branches (just git branches or get for-each-ref) as well as how to check each individual branch if it has conflicts with another (lets assume origin/develop for now):
...
-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 ...
1
vote
1
answer
88
views
Git Rebase Dilemma: Sort out the tangled feature branches
I had a feature branch which was based off of develop, let's call it feature-1. At the same point in time I also took another feature branch feature-2.
feature-1 was a real feature branch that I've ...
2
votes
2
answers
93
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. ...
1
vote
1
answer
124
views
How can I resolve merge conflicts in a Gerrit merge commit without redoing the entire merge process?
I have two branches, A and B. I merged A into B, resolving numerous merge conflicts in the process. However, while I was working on the merge, branch B moved forward.
When I pushed my merge commit to ...
4
votes
1
answer
84
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
99
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/...
0
votes
0
answers
73
views
Code disappears in target branch on git merge w/o any indication
I'm having a problem with Git merge. In short, I'm merging the master branch into a feature branch, essentially git checkout feature && git merge master.
This is how it looks graphically:
...
-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
36
views
Is there a git option to show the parent line of a source code when merge conflict occurred?
Is there a git option to show the parent line of a source code when merge conflict occurred?
I want to see the line like == line below:
== value = aws_instance.www[*].public_ip
- value =...
0
votes
1
answer
135
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 ...
-2
votes
2
answers
203
views
Why Git can't merge on the server-side if there are no conflicts
I've been using Git for a long time in a lite mode: branch, pull-commit-push, merge. Mostly with SourceTree. That was enough for development. So I'm an amateur)
But now I've got a repository that is ...
0
votes
1
answer
154
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 ...
-1
votes
2
answers
100
views
Git - Update feature branch without redoing previous conflict resolutions
In git I have a feature-branch which I just rebased of master. There were many conflicts and it took me a couple of days to get the feature-branch up and running with the latest changes from master.
...
0
votes
1
answer
76
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, ...
-4
votes
1
answer
125
views
Resolve merge conflicts when rebasing without manual intervention
Let's have a file readme.txt and such a branch structure
master
|
branch_a
|
branch_b
How this structure is organized:
When we are in master:
git checkout -b branch_a
echo "a" >>...
0
votes
1
answer
216
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 ...
1
vote
1
answer
66
views
unexpected commits records from another merged branch emerged after merging main on a branch
branches illustration
If possible, pls read the image, I think it is easier to understand
git rebase --onto main HEAD~7 caused unexpected commits rather than a single "merge commit"
All PRs ...
5
votes
1
answer
99
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
219
views
Show a combined diff of a merge commit, including added files by either parent branch
After doing a merge which includes changes of a coworker, I want to them, to outline wheat each of us changed and how I resolved the conflicts.
The standard way that git displays merges, however, is ...
1
vote
1
answer
778
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 ...
-2
votes
1
answer
65
views
How does VS Code implement 'accept both' when resolving git conflicts?
I need to implement a custom git merge bash, and I want it like VS Code's 'accept both' function. Does VS Code use some utils or AST parse tool?
Hope someone can tell me some ideas, I need to ...
0
votes
0
answers
52
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
101
views
How best to merge many git branches appending to a single file?
I have a repo with some automation that's failed badly. The automation should retrieve a file from the git repo, append "a record," which is multiple lines, push up a new branch, open a pull/...
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 ...
3
votes
0
answers
89
views
Best practice for managing requirements.txt in develop/main branches?
Our product uses a requirements.txt file to specify required third-party packages.
In the development code branch, our practice is to not use any pinned versions in this file, so that we always get ...
1
vote
0
answers
197
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
0
answers
88
views
Gitlab. Always conflicts, but no differences in files
(This maybe should go into one of the related boards. StackSomethingelse?)
At work, we routinely merge our feature branch into develop, and then the develop branch into qa. Initially, develop and qa ...
0
votes
1
answer
159
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 ...
0
votes
1
answer
91
views
TortoiseGit stuck in "merge mode", cannot restore pull option in menu
This is related to this question about why the pull option in the TortoiseGit menu is missing - a (conflicting?) merge is in process, so pull is hidden from the context menu. But when I try both ...
1
vote
1
answer
218
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
0
answers
80
views
GitFlow for feature split in sub branches
Another GitFlow question for you :)
Can you help me understand the right procedure to apply in the case below?
I want to start the development of a new big FeatureA starting from the develop branch.
...
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
0
answers
93
views
Best way to resolve conflict between feature and test branch but without affect the main?
Let's say you have 3 branches:
feature => branch you add the implementation
test => other developers merge their implementations to test branch to test it
main => main branch, implementation ...
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 ...
1
vote
1
answer
199
views
How to Auto-Resolve Git Subtree Conflicts with Three-Way Merge Strategy?
Hello Stack Overflow community,
I'm currently dealing with a scenario involving Git subtrees and conflicts. Here's a breakdown of my situation:
I have a repository A that includes repositories B and C ...
2
votes
1
answer
330
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:...
0
votes
0
answers
73
views
Detect conflicts before merging files that will cause conflicts in the future
Prerequisite
Developing the same repository with multiple (3 ~ 5) developers
Each developer works on a different branch. When work is finished, it is merged into the main branch.
What is the problem?...
1
vote
1
answer
449
views
git: How automatically merge non-conflicting changes in the same file?
I am trying to resolve a git conflict.
Let's say I have a file versions.json which is already existing in the repo:
{
"a": {
"name": "component-a",
"...