GIT

  • git branch -vv #查看当前分支上游

git diff

  • git diff null/file #工作区和暂存区
  • git diff –cached #站存区和版本库
  • git diff ap1 ap2 #比较本地两个分支
  • git diff ap1 origin/ap2 #本地和远程分支差异
  • git diff –stat #比较统计结果
  • git diff tmp #当前和tmp比较

git fetch

将远程分支拉到本地,更新fetch_head
- git fetch origin dev #拉取远程dev
- git fetch -p #拉取远程分支并修剪

**fetch之后直接git checkout可以切换到远程分支到本地**

git checkout

  • git checkout -b ap1 # 创建并切换分支
  • git checkout -b ap1 orgin/ap1 #用远程分支创建本地分支

git pull

相当于git fetch+git merge

你可能感兴趣的:(git)