We collaborate using the Github Flow method, as described below;
- Anything in the master branch is deployable
- To work on something new, create a descriptively named branch off of master (ie: new-oauth2-scopes)
- Commit to that branch locally and regularly push your work to the same named branch on the server
- When you need feedback or help, or you think the branch is ready for merging, open a pull request
- After someone else has reviewed and signed off on the feature, you can merge it into master
- Once it is merged and pushed to 'master', you can and should deploy immediately
See the commands for each step outlined below
Clone the repository using the url for the repository from github
$ git clone <repo url>
Create a local branch with a descriptive name for the feature
$ git checkout -b my-feature
... modify code, add the files and commit to git locally ....
$ git add <filename>
$ git commit -m “my feature is this”
... then push the new commit to an upstream branch with the same name. You should push changes immediately as you develop since this does not affect the master (deployed) branch.
$ git push -u origin my-feature
... When you have pushed your final change, create a pull request on the github UI from your feature branch to master.
... After your changes have been reviewed and merged into master, feature branches will be deleted automatically. Otherwise, delete branch (and remote branch) when done
$ git branch -d my-feature
$ git push origin :my-feature
To work on a new feature, simply checkout master and pull updates
$ git checkout master
$ git pull
Remove remote branches from your list that have been deleted by other people and repeat the steps outlined above
$ git remote prune origin
$ git checkout -b another-new-feature