-
Notifications
You must be signed in to change notification settings - Fork 101
Git Workflow
Paul Ray edited this page Mar 3, 2015
·
11 revisions
The basic git workflow is that developers should fork the repository and develop in feature branches, then send pull requests to the main nanograv/PINT github repository. Some useful commands for doing that are documented here.
- Fork the nanograv/PINT repository with the github web interface and check it out to your local machine with
git clone
- Set up upstream tracking of the main repo with this command (the upstream repo will be called
nanograv
): git remote add nanograv https://github.com/nanograv/PINT.git
git fetch nanograv
git checkout master
git merge nanograv/master
git branch my_feature
git checkout my_feature
- [edit files]
- Note that while you are editing your feature, it is best not to push your feature branch up to github
-
git commit
# Make sure you use useful commit messages. - Repeat
- First, make sure that the test suite
run-tests.sh
runs without error. Fix any issues - Update your master with nanograv/master as described above
- Rebase your feature onto the master, and resolve any conflicts. This way the person contributing a feature is responsible for making sure it works with the main branch.
git checkout my_feature
git rebase master
- Edit the CHANGELOG to briefly describe new features or API changes included in your branch
- Then push to github and set the local and remote branches to track one another
git push -u origin my_feature
- At this point, you can do a pull request
- If any changes are requested by the nanograv maintainer, make additional commits and
git push
. These will get added to the pull request - When the pull request is merged by the maintainer, delete your feature branch locally and on github
git branch -d my_feature
git push origin --delete my_feature