Skip to content

Git workflow for teams

Friedrich Knuth edited this page Mar 28, 2023 · 2 revisions

Git workflow for teams

Get a local copy of the repository

$ git clone https://github.com/friedrichknuth/gtsa.git

Create a branch for your work

$ 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 main 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 main. 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 main

$ git checkout main
$ 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.