1

The project I'm on has two branches, ostensibly named STABLE and DEV.

There's been some divergence in a core part of project between the two branches so when merging from Stable to DEV, we're using the ours merge strategy.

However, when pulling from Remote to DEV, we don't want to use the ours merge strategy, otherwise we'll not get the changes we need (if I understand merge strategies correctly)

So I guess the question is: is it possible to use one merge strategy when merging branches, and a different strategy when pulling from remote.

Or is my understanding of merge strategies all wrong?

gargantuan
  • 8,888
  • 16
  • 67
  • 108
  • 1
    yes, you can. For example i'm using currently merge strategy to unify stable and dev branch (on stable branch i execute: git merge dev), but when i need update some change from stable on dev, i execute: git pull --rebase stable (it is a diferently merge strategy ) – enrique-carbonell Apr 22 '14 at 17:34
  • Are you asking whether your workflow makes sense or is your question about how to specify particular merge strategy in `git pull` command? – ArtemB Apr 22 '14 at 17:36
  • @kikicarbonell rebase is not a merge strategy; it's not a merge at all. – Edward Thomson Apr 22 '14 at 18:10
  • nop, but if you apply: git pull --rebase you have change from STABLE & DEV branch – enrique-carbonell Apr 22 '14 at 19:56
  • I'm not up to speed with rebasing, i'll give that a look. @ArtemB, I'm asking how to specify particular merge strategy in git pull, and also have another merge strategy when merging branches. – gargantuan Apr 22 '14 at 20:53
  • 1
    @gargantaun `git pull` accepts the same `-s ` option that `git merge` does. Or you can do `git fetch origin` followed by `git merge` from upstream branch (or `git rebase` if you want) with whatever parameters you need. – ArtemB Apr 22 '14 at 21:12
  • Possible duplicate of [When would you use the different git merge strategies?](https://stackoverflow.com/questions/366860/when-would-you-use-the-different-git-merge-strategies) – Paul Sweatte Aug 01 '17 at 19:26

0 Answers0