...
- Get the repository:
Code Block git clone git@github.com:fcrepo/fcrepo.git cd fcrepo
- Create the branch where you'll do your work:
Code Block git branch fcrepo-780 git checkout fcrepo-780
Thecheckout
command makes whatever branch you specify the local active branch. Make your changes, test... - Add your edited/new files, then commit your branch:
Code Block git add myfile.java git commit myfile.java
- If you're working on a branch for some time, you may want to update your branch with the latest changes to master:
If there were no conflicts, the merge will be automatically committed. If there are conflicts you will need to resolve them and then commit.Code Block git fetch origin master git merge origin/master
- Push the branch back up to github
Code Block git push origin fcrepo-780
- Merge the branch into master (formerly known as 'trunk')
Resolve any conflicts, and test again.Code Block git checkout master git merge fcrepo-780
If any time has passed since you cloned master from github and merged your branch into your local copy of master, make sure that you also merge any upstream changes to master into your local copy:
Examine the changes:Code Block git fetch origin master
then:Code Block git diff origin master
(The commandCode Block git merge origin/master
git pull
does a combined fetch-and-merge, but read this on why that's a bad idea.)
Merges are automatically committed locally. - Update master on github:
Code Block git push origin master
- Once you've received word that the build has completed correctly, delete the branch
Code Block git push origin :fcrepo-780
...