git remote add <name> <url>
git remote add upstream git@github.com:central-github-repo-username/sitename.git
git fetch --all
git branch 123-my-topic-branch
git checkout 123-my-topic-branch
git checkout -b 123-my-topic-branch
git branch -a
# From the topic branch
git push origin 123-my-topic-branch
git branch -d 123-my-topic-branch
git push origin :123-my-topic-branch
# From the topic branch
git pull upstream master
git checkout master
git pull upstream master
git push origin master
git submodule update --init
# Make sure you are on origin/master - this tags the HEAD of the current branch
git tag -a v0.1 -m 'Tagging up a new release for our deploy.'
# If you wish to tag a previous revision based on an SHA
git tag -a v0.1 -m 'Tagging up the last known-good changeset for our deploy.' 58f9229d0a536d8fc69d7491c7f53787353167e3
git push --tags upstream
git checkout v0.9.16
git checkout -b b-v0.9.16
# Fix stuff
git tag v0.9.17
git tag -d v1.1.1
git push origin :refs/tags/v1.1.1
For a great overview of git cherry-pick, see /library/extracting_your_commits
Integrate upstream changes into your local master branch
git checkout master
git pull upstream master
Push upstream changes to your fork (if necessary)
git push origin master
Create a topic branch for issue #123
git checkout -b 123-blog-feature
Do some work and commit it
git add path/to/my/file.php
git commit -m "#123: Added blog content type"
Rinse and repeat.
Integrate any upstream changes.
git pull upstream master
Push the topic branch to your remote
git push origin 123-blog-feature
Issue a pull request for this branch on GitHub
Integrate upstream changes into your local master branch
git checkout master
git pull upstream master
Push upstream changes to your fork (if necessary)
git push origin master
Delete your local topic branch
git branch -d 123-blog-feature
Delete your remote topic branch
git push origin :123-blog-feature
Add a git remote for all the various members of the project, as well as a remote
for the master Acquia repository. Here's an example of what running git remote -v
should return for a project with several partners involved.
$ git remote -v
acquia acquia-username@svn-777.prod.hosting.acquia.com:acquia-sitename.git (fetch)
acquia acquia-username@svn-777.prod.hosting.acquia.com:acquia-sitename.git (push)
partner1 git@github.com:partner1-github-username/partner1.git (push)
partner1 git@github.com:partner1-github-username/partner1.git (fetch)
origin git@github.com:my-github-username/my-sitename-fork.git (fetch)
origin git@github.com:my-github-username/my-sitename-fork.git (push)
partner2 git@github.com:partner2-github-username/partner2-sitename-fork.git (fetch)
partner2 git@github.com:partner2-github-username/partner2-sitename-fork.git (push)
partner3 git@github.com:partner3-github-username/partner3-sitename-fork.git (fetch)
partner3 git@github.com:partner3-github-username/partner3-sitename-fork.git (push)
upstream git@github.com:central-github-repo-username/sitename.git (push)
upstream git@github.com:central-github-repo-username/sitename.git (fetch)
Notice that origin
is my personal fork of the repository, upstream
is the
Github master repository, and acquia
is the Acquia master repository.
Fetch updates from the desired remote. This will get you the corresponding branch.
git fetch partner1
Pull requests will generally come over via a branch on the remote repository. Checkout the branch for the submitted pull request.
git checkout the-branch-that-fixes-everything
Make sure the branch merges correctly with upstream master.
git pull upstream master
If there are no conflicts, continue with testing, e.g.
drush @alias updb
drush @alias fl
etc.
Once everything is validated, merge into master.
git checkout master
git merge the-branch-that-fixes-everything
Make sure we grab any upstream changes that may have come through.
git pull upstream master
And push to the various remotes. In this case, we push to 3: origin, upstream, acquia.
git push origin master
git push upstream master
git push acquia master
Note that if you're not ready to actually deploy the changes to the Acquia environment, you could simply leave it out of the push process.
Finally, make a tag and send that tag to the various environments. We use a three-point version number.
git tag -a v1.2.3 -m "This is the tag that fixes all the bugs."