Skip to content

Instantly share code, notes, and snippets.

@Integralist
Created March 27, 2012 08:57
Show Gist options
  • Save Integralist/2214136 to your computer and use it in GitHub Desktop.
Save Integralist/2214136 to your computer and use it in GitHub Desktop.
Git Workflow using an organisation account with Private repositories

#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 to origin

  • <local>
    Create a development branch: git checkout -b development

  • <local>
    Stage updated README, Commit & Push the development 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 only master branch is visible)

  • <local> We need to track the remote branch development: git checkout -b development origin/development

  • <local> Now we're on the development branch we can make our updates.

  • <local> Stage, Commit and Push to development branch: git push origin development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment