We have two branches in our repo, master and develop; both are protected.
Here's how it works:
- Clone the repo to your local working directory
git clone https://github.com/tmlstevens/detect-and-play
- Then
git checkout -b myLocalBranch origin/develop
(name your local branch whatever you want)
this command will: 1) create your local branch, 2) switch/checkout your local branch, and 3) cause your local branch to track changes that occur our remote branch: develop, which is displayed as 'origin/develop' if you entergit branch -a
on the command line.
When you have work that's ready to go into develop: - See what you've changed:
git status
- Assuming you want to stage everything that you've created/changed:
git add -A
- Commit your work:
git commit -m 'enter your commit message'
- Push your local branch to github:
git push -u origin myLocalBranch
- Login github
- Navigate to https://github.com/tmlstevens/detect-and-play/compare/develop...myLocalBranch (make sure you enter the name of your branch) This URL will show you your changes, relative to develop
- Click the green 'create pull request' button when you're ready to create the pull request
- Wait for one of us to review and merge your changes into develop
- When work has been merged into develop on github, get the changes in your local repo and working branch:
a) update your local repo with everything on github (origin)git fetch origin
b) make sure your local branch is checked outgit checkout myLocalBranch
c) update your local branch with origin/developgit rebase origin/develop