Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

USST git work flow

Carl Hofmeister edited this page Sep 13, 2016 · 3 revisions

USST git work flow

This wiki page explains our work flow for contributing to the rover project. I will assume that you already know how to use git. If you don't, please checkout our tutorial on git. Pick a convenient place on your local machine to work from and clone the rover-software repository.

1. Create an issue if necessary

Create an issue on Github for the change you want to make. Assign it to yourself, and on the Zenhub board, move the issue to the "In Progress" column.

2. Make sure your local repository is up to date

Assuming your repository is clean, checkout the master branch and run: git pull

3. Create a new branch to work in.

From the master branch, run git checkout -b my-branch Use a descriptive name for you branch instead of "my-branch". Use hyphens to separate words, and if the issue is relatively small and the branch will be limited to that one issue, start the branch name with the issue number (ex: 55-fix-thread-crashing).

4. Make the desired change, and commit

Make the necessary changes in your new branch. Add the changes and commit them as you go. Unless the issue only needs one change, make multiple commits as you go. If you forget to add a file, or want to change the commit message, use git commit --ammend instead of creating another commit.

5. Push your branch to Github

Once your changes are complete, push our branch to Github: git push -u origin my-branch

6. Submit a pull request

On the rover-software homepage, there should be notification asking if you want to create a pull request for the branch you just pushed. If there isn't you can go to the branches page on the code tab and click the "New pull request" next to your branch. Make sure that your pull request is for merging into the dev branch, not master. Add any comments you think people should know about, such as potential issues with merging your changes. One cool trick to keep in mind for commit messages and pull requests is that you can reference Github issues from a commit message. In your commit message includes something along the lines of "Fixes #11", "Closes #11", or "Resolves #11". When this commit gets merged into the master branch, the issue number that you referenced will automatically be closed.

A senior member of the team will merge your pull request, or ask you to make some changes before merging. At this point, on the Zenhub board, move the issue you were working on to the "Review/QA" column. If you need to make changes, just continue woking from your branch on your local machine and push any new changes with git push. You don't need to make another pull request. Once your branch is merged, you can delete your local branch if you want to. Things like bugfix branches can be deleted off of Github, but anything that may be worked on later in the future, leave it around. If you're not sure whether to delete a branch, ask someone.