Tuesday, December 24, 2013

Git workflow commands

Pull from your remote repository to make sure everything is up to date
  git pull origin master

Create a new local branch for keeping your changes way from your local master branch
  git branch my_new_feature

Switch to that branch and start working
  git checkout my_new_feature

After finishing work and running successfully any cukes/specs/tests, commit
  git commit -am "Implemented my new super duper feature"

Then, switch back to local master and pull if you need to also merge any changes since you first pulled
  git checkout master
  git pull origin master

Merge the local feature branch to master and run any cukes/specs/tests and if everything passes push changes
  git merge my_new_feature
  git push origin master

This is my preference: I delete the temporary local branch when everything is merged and pushed
  git branch -d my_new_feature

reference(copied from): http://amiridis.net/posts/13 

No comments: