-
Notifications
You must be signed in to change notification settings - Fork 74
Syncing an upstream fork of this project
If you've forked the project to customize and deploy it for your own city/county/community, but want to be able to pull in changes from the Ohana Web Search Code for America repository, this is how you would do it currently:
-
Add a remote called
upstream
that points tohttps://github.com/codeforamerica/ohana-web-search.git
. GitHub covers this in their Syncing a fork article. -
Once you're ready to pull in changes from upstream, create a new branch off of the master branch of your fork, then fetch and merge upstream, but read the note about handling conflicts below first.
# make sure your local master branch is in sync with your fork
git checkout master
git pull origin master
# create a new branch
git checkout -b upstream-updates
# fetch upstream
git fetch upstream
# merge upstream into your branch
git merge upstream/master
##Handling conflicts One important thing to note is that any modified files that you have not committed to your fork will be overwritten by the changes from upstream. If changes exist in upstream in a file that has been modified and committed on your fork, then you will get a conflict that you will need to resolve. This gives you a chance to preserve your customizations.
So, you can either:
- prevent the automatic overwriting by first making sure all files that have customizations that need to stay in the fork have been committed to the fork (i.e. changes were made and committed after the original fork of the Ohana Web Search project)
- let upstream overwrite, and then apply the customizations back using your fork's code on GitHub as a reference of what was there before you pulled in the changes.
Note that you will only have to do the above once since your changes will be committed after performing the above. The next time you pull from upstream, your changes will remain and you'll just need to resolve conflicts if any.
##Precompiling assets
If your fork uses precompiled assets to speed up deployment to Heroku and the changes from upstream include changes to the assets (anything in the app/assets
or vendor/assets
directories), you will need to precompile the assets again by:
- Throwing out your old precompiled assets folder at
public/assets/
. - Precompiling your assets again with the command
RAILS_ENV=production rake assets:precompile
. - Committing the updated assets to the
upstream-updates
branch.
Guide credit goes to @monfresh, with minor edits by @anselmbradford