Questions tagged [merge-strategy]

15 questions
14
votes
2 answers

Are there any git merge-strategies for ignoring submodule updates on a commit or branch merge into target branch?

My usecase is: I have a two branches of a repo containing submodules. I want to set up auto-integrate of these two branches. But whenever there are submodule updates on both branches, my auto integrate script fails with conflicts on submodules. Is…
Aila
  • 319
  • 1
  • 4
  • 11
2
votes
1 answer

Git and forcing to accept changes from other branch

I am trying to merge a branch into master, but want to ensure all changes from the other branch take effect, no matter what, but not sure how to go about it? The main issue is that we are ending up with merge conflicts in 50 files, where we don't…
Andre M
  • 6,649
  • 7
  • 52
  • 93
2
votes
1 answer

How to merge branch in git using `their` when in conflict

I have a master branch for production and a qa branch for testing. When I develop a new feature I create a new branch from master (e.g. new_branch), use it for develop and merge it to qa for testing. I use the following git alias: myc = "!f() { git…
Elia Weiss
  • 8,324
  • 13
  • 70
  • 110
1
vote
0 answers

k8s - multiple ownerrefs in CRDs

Say I have the following CRD: ... kind: SomeCRD metadata: ownerReferences: - uid: aaa name: name-a ... When I run kubectl apply -f some.yaml where some.yaml is the following ... kind: SomeCRD metadata: ownerReferences: - uid: bbb …
1
vote
1 answer

git should give me operation as conflict when same file modified in different branches

Lets consider file.txt aaa bbb ccc In branch A, I'm changing file content file.txt aaa-update bbb ccc In branch B, I'm changing file content file.txt aaa bbb ccc-update When I merge branch B into branch A I get below…
1
vote
1 answer

Assembly scala project causes deduplicate errors

I'm trying to assembly my scala project and cant get rid of some deduplicate errors Here is the problematic output: > [error] 2 errors were encountered during merge [error] stack trace is > suppressed; run 'last >…
soosita
  • 187
  • 13
1
vote
3 answers

Replace whole state of application with state of another commit

I'd like to do "the hardest version" of cherry-pick/merge/rebase/checkout, what means that state of app on my branch begins to look exactly like in the cherry-picked commit (but with keeping history of my branch). In fact I could duplicate my repo,…
Karol Selak
  • 4,248
  • 6
  • 35
  • 65
1
vote
1 answer

GitLab - ignore specific files in target branch

I am using GitLab in my project and I have a quite specific workflow. I have 2 branches "Dev" and "Release" as shown below. When I submit a merge request from Dev to Release, the config files are also getting overwritten with that of Dev branch.…
Sriks
  • 1,669
  • 6
  • 26
  • 40
1
vote
1 answer

Git - Automatically Merge

-Initial File Content: 1 2 3 -File Content at Branch A): 1 changed line by A 2 3 -File Content at Branch B): 1 2 changed line by B 3 -File Content i want to achieve at Branch B after merging A into B: 1 changed line by A 2 changed line by…
CodeHunter
  • 11
  • 4
1
vote
1 answer

Make All Merges Manual in Git

I need to know how to manually edit every merge. I found answers on here but everything is only when there is a conflict of merging. I implemented these and if there are new files pulled or no direct conflict between the code it will auto merge,…
0
votes
2 answers

Change merge strategy from 'ort' to 'recursive'

I don't know how, but default merge strategy is ort in my pc, but I want to change that to recursive. I referred some online sources but none of them were useful. Can someone tell me how can I change my default merge strategy?
0
votes
0 answers

Override merge without loosing commits in Git

In my master branch There are old commits which are important for me to not loose I have another branch named beta-release and it lost those old commits since I had to reset its head and then had to add all the changes and make a commit , resulting…
Waqas Tahir
  • 7,171
  • 5
  • 25
  • 47
0
votes
1 answer

Why is my Git ours merge strategy being ignored?

I want to ignore a certain file from being overwritten regardless of whether there are changes. I have the following in /etc/gitconfig: [merge "ours"] driver = true And in the repository itself, in .git/info/attributes: files/somefile.txt…
LeonardChallis
  • 7,759
  • 6
  • 45
  • 76
-2
votes
1 answer

Pull Request Flow

I want to implement branching strategy in bitbucket-cloud where a pull request to master can be done only from release/* branch and hotfix/* branch. No one branches would be allowed to raise a Pull request to master. Similarly a Pull request to…
-2
votes
1 answer

How to use THEIRS git merge strategy in android studio?

We developed in some branches with lot of commits in them and because we where not sure about the probable bugs. After a lot of changes we decide to migrate whole project into master branch without any changes so we select master branch but there is…
Mohammad H
  • 785
  • 2
  • 10
  • 25