Question

My team and I have checked out orchard 1.7.2 a few months ago and added many modules/features to the solution. Unfortunatly at the time we didn't set any git 'upstream' remote to orchard's source nor did we version orchard's source code.

I would like to change the way we follow evolutions in orchard source code by setting things properly.

The way I see it:

  • If possible, we would like to keep our git history ;
  • We need to set up a git remote pointing to https://git01.codeplex.com/orchard (orchard's source code) to keep track of orchard's latest updates in a few git commands ;

So that updating to the latest version would be as simple as:

# Update local repo's master to raw latest orchard
git fetch upstream
git checkout master
git merge upstream/master

# Update development branch, merge changes and adapt custom code
git checkout dev
git merge master
#update code and run tests
git commit -m "updated orchard from 1.7.2 to 1.8.0"
git push origin

How would you proceed, knowing that currently:

  • Our project is hosted on BitBucket ;
  • It contains only one branch, master ;
Was it helpful?

Solution

If i understand you right, your work is heavily based on the orchard-source. To keep the things simple you may just create a second remote for orchard (which only tracks the remote's master-branch) like this:

git remote add -t master orchard https://git01.codeplex.com/orchard

After that you're able to fetch or pull from that "new" remote. You may consider doing the "pulling in" from a special "integration"-branch to have more freedom within your master.

In this example I'm merging the 1.8.x-branch into a integration branch:

$ git checkout -b integration
Switched to a new branch 'integration'
$ git pull -f orchard 1.8.x:integration
From https://git01.codeplex.com/orchard
 + 74136b6...37e9a33 1.8.x      -> integration  (forced update)

But be aware the normal merge will fail since your codebase can't be matched with orchard's codebase - they rely on different commit-ids. This is why you need to use the --force-flag which disables the id-check and merges the stuff like hell.

After that - of course - you'll have a lot of merge-conflicts to solve.

To avoid the trouble with the merge-in in the future i'd recommend you to fork the orchard-repository and do the merge-in the other way round. Merge your project into the orchard-fork. Then you'll be able to rebase on future orchard-commits.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top