#Overview - setting up our git workflow
This set-up works for our team as we don't mind pushing directly to a development
branch, but this wouldn't work for other companies as the development branch could potentially get broken fairly quickly and with multiple developers working on this singular branch would be awkward to locate issues and fix - but for a small team this seems to work fine.
##Initial User Set-Up The first developer to work on the new project will go through this process:
-
<github>
Create repository on GitHub company account -
<local>
Create folder and initialise repo:git init
-
<local>
Add remote:git remote add origin <path/to/repo>
-
<local>
Stage, Commit & Push a README file toorigin
-
<local>
Create adevelopment
branch:git checkout -b development
-
<local>
Stage updated README, Commit & Push thedevelopment
branch to GitHub:git push origin development
##New User If another member of the team wants to work on this repository then they'll follow this process:
-
<github>
Find the SSH url to the repo -
<local>
Clone the remote repo using the SSH url (notice onlymaster
branch is visible) -
<local>
We need to track the remote branchdevelopment
:git checkout -b development origin/development
-
<local>
Now we're on thedevelopment
branch we can make our updates. -
<local>
Stage, Commit and Push todevelopment
branch:git push origin development