Git常用操作

克隆仓库

  git clone path

  

标记提交

  git add FileOrDir

正式提交(并添加注释)

  git commit FileOrDir -m "note"

  

推送至远程库

  git push origin

  

查看本地库状态

  git status

  

创建分支

  git branch newBranchName

  

切换分支

  git checkout branchName

  

推送分支至远程仓库

  git push origin newBranchName

  

合并分支

  git checkout master

  git merge dev

  

创建标签

  git tag tagName

  

查看所有便签

  git tag

  

推送标签至远程仓库

  git push origin tagName

  

查看日志(提交记录)

  git log

  

原文地址:https://www.cnblogs.com/luoxiaolei/p/9035775.html