Skip to content

Workflow

cazinge edited this page May 17, 2016 · 4 revisions

Our team uses a "forking workflow" in order to lessen the amount of issues, conflicts, and bugs that we have with our code.

In essence, all of the work that you'll be doing on your machine will be pushed to a sever-side repo under your account, then from there you will initiate a pull request.

Explaining terms used

  • Fork: Splitting off the project into your own repository. Allows you to work without fear of conflicts after every commit. In order to sync with upstream, pull from it.

  • Origin: This is the term used to describe your personal fork of seaver-connect. "origin" is also the default remote name of the repository that you clone locally.

  • Upstream: This is the term used to describe lmucs/seaver-connect. You will have needed to create a new remote tag for this using the SSH URL in order for git bash to recognize this name, but as you will not be committing/pushing directly to this there is no real need to do so formally.

  • Remote: This is the term used to describe a server-side repo such as origin and upstream.

In order to add lmucs/seaver-connect as a new remote, type: git remote add upstream git@github.com:lmucs/seaver-connect.git

In order to change origin to use the SSH URL instead of the HTTPS URL to avoid repetitive login, type: git remote set-url origin [your SSH URL goes here]

Setting up a server-side repo

  • Fork lmucs/seaver-connect.

Before initiating a pull request, make sure origin is up to date with upstream

Setting up a local repo

  • In git bash of the local directory that you would like to clone origin into, type: git clone [your origin URL goes here]

Pushing code to origin

  • Add the changes that you've made to your local git repository using: git add [your file name goes here]

  • Then after you've aggregated all of the changes that you've made for the current commit, use: git commit [optional: -c "commit message goes here"]

  • This will commit all of the files that you had added to that commit prior. Finally, to push this commit out to origin using: git push [optional: remote] [optional: branch]

  • Alternatively, if you wish to just add all the changes in your current directory, ignore all of the git adds prior and just type: git commit -a

While in vim (the virtual machine after you initiate a commit) ESC -> type ":wq" -> ENTER to save your commit. ":wq" means save and quit. If you wish to quit without saving, type ":q".

Code review process for adding code to upstream

  • Once you are happy with the state of origin and believe that your fork should be reintegrated with upstream, initiate a pull request.

  • This will allow other members of the team to view the changes that you have made to the project without it disrupting anything that they individually have been working on.