Skip to content

Branches

Tianshu Huang edited this page Oct 13, 2018 · 2 revisions

Branches

Branch basics

"Check out" a branch to work on it using git branch:

$ git checkout control
Switched to branch 'control'
Your branch is up-to-date with 'origin/control'.

Make sure you're working on a branch that isn't protected (not master and dev). If you've accidentally worked on one of those branches, git commit, then check out another branch and merge in your local changes:

git add --all
git commit
git checkout control
git merge master

Once you've committed and pushed your changes to your team branch, issue a pull request. Click on the Pull requests tab of the repository page, and click the New Pull Request button. Then, select your branch, and the destination branch (which should usually be dev).

After your pull request is committed, it must be reviewed and approved before it can be merged. While anyone can review or approve a pull request, only repository administrators can make the final merge. Administrators should check that the code has been fully reviewed (preferably in part by themselves) before merging.

Creating a new branch

Branches should be named according to the format module/submodule. Modules currently include vision, control, tools, and drivers; the module for an issue should be one of the tags on that issue.

For example, the convexhull submodule in vision should be stored in a branch vision/convexhull:

git branch vision/convexhull
git checkout vision/convexhull
# make your changes
git push --set-upstream origin vision/convexhull

master

  • Protected
  • Only push working and tested code to this repo
  • Only admins can merge pull requests.
  • Even admins cannot push directly

dev

  • Protected
  • Only push working code to this repo (it's OK if there's non-critical bugs)
  • Only admins can merge pull requests.
  • Admins can push directly (please don't abuse this).

scratch

  • Not protected
  • Do whatever you want
  • People will probably hate you if you abuse this, but it's not a big deal
  • Memes are allowed
Clone this wiki locally