3,456 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)
...
-1
votes
1
answer
55
views
How to merge two different git repos into one?
I was given access to a GitHub repository that doesn’t belong to me.
My goal: I want to clone this repo into my own new GitHub repository and then push it there.
I’ve already cloned the repo locally, ...
0
votes
2
answers
96
views
Safest way to resolve push conflicts and messy commit history after rebasing local branch with updated main?
I recently rebased my local feature branch onto the latest main branch to get up-to-date. Now, my commit history looks all weird—some commits seem duplicated or out of order, and when I try to push, I’...
-1
votes
2
answers
61
views
Squashing unrelated history merges [closed]
I have just been messing around with some other repos and doing some git merge --allow-unrelated-histories:
I now want to squash these together such that they are all part of the same history. (...
-2
votes
3
answers
173
views
How can I work on multiple git branches at once?
Clarification: I'm asking about working on multiple branches in the same worktree. (I know how to work on multiple branches in separate worktrees, but that's not the question here.)
Suppose I'm ...
1
vote
1
answer
699
views
Embarrassing myself with git merge - adds a bunch of files and commits to my PR that I hadn't touched
Git novice here. tl;dr: I don't understand why already merged commits end up in my PR. Going to number my steps here so people can point out where I went wrong with a number.
So I'm working on a ...
1
vote
0
answers
85
views
Strange characters appearing on merge conflict
I'm working on a French WinForm application and in the team we are using multiple git clients (VS studio, GitKraken, etc.) to manage branches and so on.
I'm currently using Git Fork with the ...
0
votes
1
answer
163
views
Why do some merged commits have no effect?
Here is my workflow with git:
A 'master' branch.
A 'devel' branch, that I merge into master when it is mature for a new release.
Several little branches, such as 'imprimerie', 'ordomatic', etc.
...
0
votes
0
answers
112
views
How to Exclude Specific Files from a GitLab Merge Request After Accidentally Merging Deployment Branch Configs?
Problem
I accidentally pulled from a deployment branch (deploymentdev) into our main development branch (main) and pushed it. This brought deployment-specific configuration files (Jenkinsfile, .gitlab-...
-2
votes
2
answers
97
views
Bring back a branch to be fast-forward merged again
In my codebase we have two branches (relevant to this question) we have main and TestFlight.
When we want to make a release, we do the following
$ git checkout main
$ git pull
$ git checkout ...
0
votes
0
answers
66
views
Git merge does not update target branch with all changes from source
I have branch "feature" with changes that I want merged into my "master" branch with the git merge feature command.
My expectation is that target branch would get overwritten with ...
-2
votes
1
answer
82
views
How to merge accidently missed release into current branch
The scenario:
It's 2025 right, so we decided to create new branch for this year 2501.x version. And found we accidentally missed some feature branch versions are not merged to our current release i.e.)...
0
votes
0
answers
16
views
Gitlab must execute either one of the 2 job groups and succeed if all jobs in the executing job group succeeds
I have a scenario when I'm trying to merge code from DEV branch to QA branch. This is very specific to merging in QA branch only.
I have 4 jobs that are separated by 2 groups in gitlab yml file.
Group ...
-2
votes
3
answers
108
views
Rename detection makes `git rebase` remove a random file
I have a script that among other things uses git rebase to remove a specific commit from the current branch.
In one case, it removes a seemingly random file.
After long debugging session, I've managed ...
-1
votes
3
answers
245
views
How do I perform GitHub’s “Rebase and merge” in git with a single command?
Essentially, I want to merge a feature branch into main when the two branches have diverged and I can't fast-forward the merge.
If doing this manually, I would checkout the feature branch, rebase it ...
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 ...
1
vote
1
answer
123
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 ...
1
vote
1
answer
31
views
$REMOTE point to different branches in git merge vs. rebase?
I want to configure kdiff3 to use a specific order for windows (from left to right): $REMOTE | $BASE | $LOCAL. However, I encountered an issue where $REMOTE differs between merge and rebase commands.
...
0
votes
1
answer
53
views
How to organize git cherry-pick action?
Let's say I need to move several feature commits to the release branch. Should I move them from their immediate commits, not merge commits?
An example of what I mean is in the image
I want to move ...
1
vote
0
answers
53
views
Pushing master branch after merging detached head creates 2 commits instead of 1
I did the following:
Checkout detached head with specific id.
Make changes to detached head and save it in a new branch gallery-section-detached-head.
Merge gallery-section-detached-head into local ...
1
vote
1
answer
77
views
Rebase part of one repository history on top of a similar but different repository
We have a couple of repositories, let's call them RA and RB which are similar but not the same. RA is a export of an SVN repostiory were some libraries were extracted in the export process and RB is ...
0
votes
1
answer
37
views
The file is not visible even though I changed the branch using Gitflow
I cloned it again and set up Gitflow to change the branch from main to development, but the file is not visible.
After deleting the file, I cloned it again and set up Gitflow again, but it was the ...
0
votes
1
answer
110
views
gitkraken conflicts prevent checkout
I am using GitKraken and am currently trying to change from the feature branch to the develop branch, but an error saying conflicts prevent checkout. What should I do? It has currently been merged ...
0
votes
1
answer
98
views
Plumbing way to do no-fast-forward merge
I'm working on a project that involves using git plumbing methods. I want to implement git no-fast-forward merge (aka three-way merge). I'm not sure which plumbing methods would be suitable for this ...
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 ...