Skip to content

How to work on this project?

Ultimate Pea edited this page Nov 2, 2018 · 24 revisions

Welcome to the JavaSketchPad wiki!

First follow basic git tutorial at http://ieng6.ucsd.edu/~cs15x/labs/lab5_cxvkjf/index.html. Make sure you config git username and password

$ git config --global user.name <Your Github Username>
$ git config --global user.email <Your Email>

Before you make any changes, make a copy of the develop branch.

git clone by default clones the master branch, you need to get the develop branch, using the following command

$ git clone https://github.com/UCSDOalads/JavaSketchPad.git
$ cd JavaSketchPad
$ git branch -a
$ git checkout -b develop origin/develop

Now you are on the develop branch, before doing any work, create a new branch. Please do not edit file directly on develop branch, and your new branch should be directly pushed to the remote.

Create a new branch by

$ git checkout -b <YOUR_NAME>/addXXXX

where XXXX is the Changes you want to make.

You can verify that you created a new branch by

$ git branch

Now you can work and commit on all files as you wish.

To commit and add all files,

$ git add --all
$ git commit -m "<commit message>"

Before you submit to the remote server, verify that you saved all files by using

$ git status
On branch <YOUR_NAME>/addXXXX
nothing to commit, working tree clean

You should see the above result.

To get ready for submission, if the develop branch has been updated since the last time you branched, update develop branch, and merge develop branch into current project. Resolve any conflicts.

$ git checkout develop
$ git pull origin develop
$ git checkout <YOUR_NAME>/addXXXX
$ git merge develop

You should verify that the project compiles and all functions work as expected before you submit the change.

After you're done committing changes, push your local branch directly to remote using

$ git push origin <YOUR_NAME>/addXXXX

Your code will go through a code review process by a reviewer.

Please visit the pull requests tab (the third tab on this page) to create a new pull request. Select develop as base branch and your branch <YOUR_NAME>/addXXXX as the compare branch. Verify the file changes and assign a reviewer.

After your code has been reviewed and merged to develop, you can update your local develop branch by

    1. go back to develop branch.
    1. pull changes from origin/develop.
    1. delete the temporary branch you created.
$ git checkout develop
$ git pull origin develop
$ git branch -d <YOUR_NAME>/addXXXX

To make new changes go to create a new branch section