Skip to content

Instantly share code, notes, and snippets.

@NearHuscarl
Last active April 17, 2018 05:00
Show Gist options
  • Save NearHuscarl/322a82b1595db5ed7b0040dd3f7ecb7a to your computer and use it in GitHub Desktop.
Save NearHuscarl/322a82b1595db5ed7b0040dd3f7ecb7a to your computer and use it in GitHub Desktop.
github development workflow

Clone repository:

$ cd /dirname/
$ git clone git@bitbucket.org:user_name/repository_name.git

Create a new branch

$ git branch new_branch

Change git branch to the new_branch

$ git checkout new_branch

Coding, making commits, as usual…

$ git add .
$ git commit -m “Initial commit”
$ git push (pushes commits only to “new_branch”)

When job is finished on this branch, merge with “master” branch:

$ git merge master
$ git checkout master # (goes to master branch)
$ git merge development # (merges files in localhost. Master shouldn’t have any  commits ahead, otherwise there will be a need for pull and merging code by hands!)
$ git push # (pushes all “new_branch” commits to both branches - “master” and “new_branch”)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment