Skip to content

Git workflow for teams

Anthony Arendt edited this page Sep 6, 2019 · 2 revisions

Git workflow for teams

Get a local copy of the repository

$ git clone [email protected]:geohackweek/sample_project_repository.git

Create a branch for your work

$ cd <path_to_repository>  
$ git checkout -b <branch_name> 

Crank away and work! When it is time to commit some changes.

$ git add .  
$ git commit  
$ git push origin <branch_name>  

Create a Pull Request (PR) to the master branch using the GitHub UI and ask a teammate to review your changes. After the review is complete, merge the branch in the UI with master. A good practice is to also delete the branch after the merge is complete in the GitHub UI.

Pull down the merged PR to your local master

# Go back to the master branch
$ git checkout master
$ git pull

Delete the local branch

$ git branch -d <branch_name>

Rinse and repeat

Repeat the above steps from creating a branch, pushing to master, making a PR, pulling down to your local master, and deleting the branch for every chunk of work your are planning to do.