Git Collaboration strategy

Part 1, Creating The Dev Branch

  1. cd ~/dev
  2. git clone https://github.com/GitUser/NameOfProject.git
  3. cd NameOfProject
  4. git checkout -b dev
  5. git add .
  6. git commit -m 'first commit'
  7. git push -u origin dev

Part 2, Creating a Feature Branch

  1. git fetch origin
  2. git checkout dev
  3. git checkout -b feat/name-of-feature

Part 3, Synching a Feature Branch With Dev Branch

  1. git fetch origin
  2. git checkout feat/name-of-feature
  3. git pull origin dev
  4. git add .
  5. git commit -m 'feature branch synched with team branch'
  6. git push -u feat/name-of-feature

Part 4, Merging a Feature Branch into Dev Branch

  1. git fetch origin
  2. git checkout dev
  3. git merge feat/name-of-feature
  4. git add .
  5. git commit -m 'merged feat/name-of-feature into dev'
  6. git push -u origin dev