-
Notifications
You must be signed in to change notification settings - Fork 11
HowTo: track upstream changes
By default the remote origin is the vagrant-drupal repository on github. It is designed to function after you clone it for development and testing purposes. This means you can commit to your local repository and track upstream changes. This is useful for single user development workflow. However we also kept in mind people work on teams and need to share these repositories for each project they are working on. To do this we recommend the following.
- Rename the remote origin:
git remote rename origin github
- Create your bare repo
- Add your own remote origin:
git remote add origin <your_repo_name>
- Set your master to the remote origin:
git config branch.master.remote origin
- Push your changes to your bare repo:
git push origin master
If you are cloning directly from our repo it won't contain the original github project. In that case, you will need to add the upstream remote:
git remote add github git://github.com/xforty/vagrant-drupal.git
Then follow the steps in Merge in future versions below to pull in the repository. In order to pick up RVM run the following:
cd .. && cd -
If you are initially adding vagrant-drupal to an existing project or you want to pull in the latest changes run the following:
git pull github
git branch github_develop github/develop
git merge github_develop
- Fix any conflicts you have and commit the changes. The more changes you made the more conflicts you are likely to have. See Dealing with merges.
git push origin master
git branch -d github_develop
If the Cheffile.lock file changed you can simply run the following to pull in the new chef cookbooks:
librarian-chef install
Merging conflicts can be a bit of a pain. If you clone from master you are less likely to get a conflict. If you clone from develop then merge a version tag, you more likely get of conflicts.
When you are in the middle of a conflict you might decide that you want to take all the changes from upstream. You can simply run this command then add the conflicted file.
git checkout --theirs README.md
The counterpart is to simply take your changes
git checkout --ours README.md
What this does is checkout our version (--theirs) or your version (--ours) of the file.
One annoying aspect to merging in upstream changes is seeing the history from the vagrant-drupal project. The easiest way to clear that out is to run the following command:
git log --first-parent