Git Jira Workflow - CPSECapstone/Turtle GitHub Wiki

Git / Jira Workflow

Setup

  1. Set up local fork
    1. Go to https://github.com/CPSECapstone/Turtle
    2. Click on the Fork button to create your own copy of the repo
    3. Click on the number next to Fork to go to your fork
    4. Click the Code dropdown to find your HTTPS url
    5. Copy that and make a local repo using that url
      1. git clone URL
    6. Use this local repo as the place you make changes
  2. Set up upstream connection
    1. Go to https://github.com/CPSECapstone/Turtle
    2. Click the Code dropdown to find your HTTPS url
    3. Copy that and use it to create your upstream
      1. git remote add upstream URL
    4. Test it with
      1. git remote

Basic

  1. Pull issue from _Todo _to In Progress in Jira
  2. Checkout and update develop branch
    1. _git checkout develop
    2. _git pull upstream develop
  3. Checkout a new branch for your issue
    1. git checkout -b TUR-69
    2. Name the branch after the issue name on Jira
  4. Do work
  5. Checkout and update develop branch (see 2)
    1. If changes in develop see rebasing
  6. Checkout current branch
    1. git checkout TUR-69
  7. Push branch to origin
    1. git push origin TUR-69
  8. Create a new Pull Request on github
    1. https://github.com/CPSECapstone/Turtle/pulls
    2. Make sure its merging your local branch into the upstream develop branch
    3. Write a short description as well as the name of the issue as the title
    4. Assign someone to review your code
    5. Review all code before submitting
  9. In Jira move your issue from In Progress to Code Review

Rebasing

  1. Imagine 2 people are working on the same file for separate issues and the other person gets their issue merged in first
  2. _git checkout develop
  3. _git pull upstream develop
  4. git checkout TUR-69
  5. git rebase develop
  6. If there are merge conflict fix them and add all changed files to staging
    1. Then run the command to continue
    2. git rebase --continue
  7. Force push the changes upstream
    1. git push -f origin TUR-69
⚠️ **GitHub.com Fallback** ⚠️