Git

To create a new branch from ‘dev’

  • git checkout dev
  • git pull
  • git checkout -b QA

To Add and Commit in one go

  • git commit -am “message”

Switch Branch

  • commit all the changes in your current branch by:
  • git commit -am “message”
  • git checkout otherBranch

Pull the latest code from dev into your branch

  • while in your branch
  • git pull origin dev
  • git push

Add all modified files (stage files)

  • git add .    or    git add -u

Reset a staged file

  • git reset — filename

Discard Changes To A File

  • git checkout — filename

Delete Local Git Branch

  • git branch -d branchName