Git - The most common git commands in the day-to-day work

We use git commands in the day to day work, below are the most common git commands I could think of.

  1.  Create a new branch
    • git branch <branchName>
  2. Switch to the new branch
    • git checkout <branchName>
  3. Create a new branch and switch to it
    • git checkout -b <branchName>
  4. Track updates from remote branches but not pull in
    •  git fetch
  5. list all branches locally
    • git branch
  6. list all branches remotely
    • git branch -r
  7. pull from pointing remote branch
    • git pull
  8. pull from the remote branch
    • git pull origin <branchName>
    posted @ 2018-05-19 00:51  iRabbit  阅读(108)  评论(0编辑  收藏  举报