Skip to content

Instantly share code, notes, and snippets.

@arifsetiawan
Last active August 29, 2015 14:01
Show Gist options
  • Save arifsetiawan/e3863c2ebec9ab0258b4 to your computer and use it in GitHub Desktop.
Save arifsetiawan/e3863c2ebec9ab0258b4 to your computer and use it in GitHub Desktop.
Git workflow #1

Git workflow #1

Create your working branch

Clone the repo

$ git clone https://[email protected]/someuser/great-website.git greatwebsite

Create your working branch

$ cd greatwebsite
$ git checkout -b dev

Work on your code, then commit

$ git add .
$ git commit -am "commit message"
$ git push origin dev

Make sure you are working on your working branch (in this example dev)

Merge master branch

Your master branch is updated and you have to merge the latest code to your dev branch.

Update the repo

$ git fetch origin
$ git merge origin/master

Merge the conflict the commit the merge. Your dev branch is updated with code from master. This will make merging to master easier at later stage.

Continue to work on your dev branch and keep pushing!

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