1

I currently have three standard permanent branches I have pipelines associated with.

Those branches are development, test, and production.

I am branching off development and making several commits. I'm then trying to merge development into 'test'. Then merging 'test' into production branch. I am running into constant 'fatal' refusing to merge unrelated histories.

I'm not following a good workflow too, and don't think using cherry-pick is the preferred or ideal way.

What do you suggest I change my workflow to, to avoid what's happening, and how can I course correct my branch states?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
james
  • 408
  • 7
  • 22
  • 1
    Are these actually unrelated, or are you working in a shallow clone? – torek Oct 25 '21 at 04:32
  • Same repo, but two different branches which all have started off production as the default branch – james Oct 25 '21 at 17:55
  • So the branches *are* related, and you just have a shallow clone, that's making Git unable to see the relationship. In that case, use a deeper (or non-shallow) clone. – torek Oct 25 '21 at 18:04
  • they started as So I believe I started off in a state like this. The workflow I want though is to branch off development for a feature, merge through test, and then from test to production since each of the three branches is tied in my CICD pipeline to different environments. Production |______ Test |______Development – james Oct 26 '21 at 00:04
  • Yes I did not specify any additional flags when i cloned them. I looked at the no-single-branch flag. Would I need to delete my branches and recreate them with no-single-branch? – james Oct 26 '21 at 00:12
  • `--single-branch` and `--no-single-branch` don't affect the *depth* of a clone; it's `--depth` that affects the depth. (But in the other direction, `--depth` turns on `--single-branch`, so that you then have to turn it *off* again.) Your comment doesn't show anything sensible here though, since that's not possible in comments (they can't be formatted). Consider coming up with a [mcve], if you can. – torek Oct 26 '21 at 00:19

1 Answers1

0

If you are alone working on this repository, I would suggest resetting those branches locally, and making sure they are all starting from main.

From there, after force pushing them, I would try again pushing new commits to dev, then merging dev to test, to see if the issue persists.

I also run into a lot of merge conflicts on configuration files in test that are not in development or different in development than on test.

That would be resolved/avoided through content filter driver.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Yes I am solo developer on the repository – james Oct 26 '21 at 00:13
  • I also run into a lot of merge conflicts on configuration files in test that are not in development or different in development than on test. – james Oct 26 '21 at 00:14
  • @james On your second comment, see https://stackoverflow.com/a/67898483/6309: no more conflicts. – VonC Oct 26 '21 at 06:40