0

I did search all the questions that are similar to mine but still, I am not able to achieve what I wanted to. Please advice if this is possible:

  1. I have publicRepo/master branch
  2. I have privateRepo/master branch

I would like to simply take the latest of publicRepo/master and merge with privateRepo/master. But I would like to take everything from publicRepo/master regardless of merge conflicts (similar to what used to be git pull -s theirs)

How can this be done, so far I have tried these solutions:

1) Merge 2 Different git Repos (I end up with 3 way merge and get theirs when there are conflicts) 2) Merging two Git repositories

I also tried:

git fetch --all (as I added publicRepo/dev as one of my remotes)

git reset --hard publicRepo/dev

git pull (does a 3 way merge, which I do not want, I want everything from my publicRepo/Master)
Community
  • 1
  • 1
  • Checkout public master, fetch private master, merge private master into public master with `--strategy=ours`. This simply takes the tree of public master and ignores all changes from private master. Do not use `--strategy=recursive -X ours`. – ElpieKay Jan 24 '17 at 09:36

1 Answers1

0

You can try using git fetch upstream after making the publicRepo as upstream.

  1. Add the remote of public repo:

    git remote add upstream {publicRepo}

  2. Fetch the latest data from upstream public repo, while checkout out in your private repo:

    git fetch upstream

Aditya Singh
  • 15,810
  • 15
  • 45
  • 67