git clone <your-copy-of-dream>git remote add upstream {github-project-uri}git fetch upstreamFor sake of clarity, all following discussion will use {branch} as the target upstream branch. Always substitute the actual name of the upstream branch you are targeting as appropriate, otherwise you might do unintended cross-branch merges
The problem with working on your copy of {branch} is that if your pull is not accepted your copy is now out of sync and has to be reset in a fairly drastic manner. In addition, if you like to make a lot of WIP/intermediate commits, that entire history will become part of the upstream history. We may squash commit history as we execute the pull, but a clean history is preferable, since then the pull is a single button click.
It's usually best to create a work specific branch for every bug or task. This has several benefits:
We will NOT cherry pick from your changes. Either the pull request can go in unaltered, or it will be rejected.
All development should happen on a branch of the of the target you are aiming for. I.e. if you work on a branch of master, your work will only go into master, while work on branch of {major}.{minor} will got into that target and master.
git fetch upstreamgit checkout -b {feature} upstream/{branch}git push origin {feature}
git branch --set-upstream {feature} origin/{feature}
git pushgit fetch upstreamgit merge upstream/{branch}git commit -a -m'added x to feature'git branch -d {feature}git push origin :{feature}If you usually create a lot WIP commits, you might want to review the commit history that your pull request will send upstream
git log upstream/{branch}..{feature}git fetch upstreamgit checkout -b {feature}_pull upstream/{branch}WARNING: This should only be done if you have committed changes to your copy of {branch} that will not make it into upstream/{branch} and you want your copy of {branch} to mirror upstream once again. This will wipe out all changes in your copy of {branch} that do not exist in the upstream!!!
Your {branch} should always stay as close to the upstream version as possible, and only drift for changes you are planning on pushing soon. For this reason, you should merge often refresh if your changes didn't make it into upstream verbatim.
git fetch upstreamgit checkout -b temp upstream/{branch}git merge --strategy=ours mastergit commit ...git checkout {branch}git merge tempgit pushgit branch -D tempCheckout a branch you want diff against (see instructions above for that)
git diff master..2.2Sometimes a merge may pull in changes you didn't expect and since merge automatically commits you may find yourself with a whole bunch of unwanted commits.
git reset --hard HEADFor illustration the below workflow assumes the version of master is 2.3.0.0. The syntax also assumes that the commands are issued from the Msysgit Bash shell.
Note: Running the distribution msbuild project assumes that there are no local changes, since it intends to revert any changes it makes post build. If there are local changes it will error out unless -p:IgnoreModified=true is set (which also prevents the revert).
git checkout -b 2.3MSBuild.exe -t:UpdateVersiongit commit -a -m'created new production branch'git pushgit checkout masterMSBuild.exe -t:UpdateVersion -p:Version=2.4.0.0git commit -a -m'updating version'git pushWhen we build new binaries, it is either for a release of a release candidate. More often it is the latter. I.e. let's say we need to get new DReAM changes for the stable branch of MindTouch, we will build binaries that become the release candidate for the next version of DReAM.
MSBuild.exedist/ and revert the changes thereafter, since we never commit the build informationFor a release candidate, we just copy the contents of dist/ to its destination and we are done.
For the actual release (either because it's a part of a release of MindTouch or we have an out-of-band release of DReAM), we have some extra steps
dist/ directory as mindtouch.dream.2.3.1.zipgit tag -m'Official 2.3.1 release' 2.3.1git push --tagsMSBuild.exe -t:UpdateVersiongit commit -a -m'incremented release'git push| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by