tldr
cd buildkit/build/dmaster/sites/all/modules/civicrm
## Ensure that all your stuff is clean/committed.
git scan status
## Update git repos. Choose ONE of:
git scan up
./bin/givi checkout X.Y.Z
## Regenerate data. Choose ONE of:
civibuild reinstall dmaster
./bin/setup.sh -Dg && drush civicrm-upgrade-db
Checking the git repos
There are multiple git repos in your build (civicrm-core.git
, civicrm-packages.git
, etal). Before making a major switch, I first double-check that all of these repos are in sane condition -- ie there shouldn't be any uncommitted changes, the repos should be on normal branches, etc.
git scan status
Updating the git repos
As a developer who tracks mainline branches, my day-to-day interest is "updating to the latest revision of master
or 4.6
". The command git scan up
will perform a standard "fast-forward merge" (git pull --ff-only
) across all the repos:
git scan up
(Tip: If you didn't cleanup earlier, then "fast-forward" may not be possible. It takes some judgment to decide what to do -- e.g. a "merge" versus "rebase". Rather than risk a wrong decision, git scan
will skip these repos and display warnings instead.)
Your example uses a tag. Hopping among tags is a bit different than tracking a branch. For this, I use givi
:
./bin/givi checkout 4.7.17
Updating the generated code, config files, databases
As a developer who does weird things on a day-to-day basis (like manually hacking SQL records to provoke weird situations), I have trouble remembering all the weird things that I've done before -- and honestly don't care about them afterward. I just want to get back to a consistent/clean state. Reinstalling is nice because it recreates/overwrites all generated-code, config-files, and database content.
civibuild reinstall dmaster
However, that does reset all the data. If you care about the content in the database, then don't do a reinstall. Instead, update the generated-code and perform a DB upgrade:
./bin/setup.sh -Dg
drush civicrm-upgrade-db
See also
For more discussion, see the blog post: https://civicrm.org/blogs/totten/developer-tip-managing-multiple-git-repositories