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>

    猜你喜欢

    转载自www.cnblogs.com/iloverabbit/p/8587034.html
    今日推荐