Git常用命令

git工作原理

这里写图片描述

git常用命令:

  1. git log 查看版本库日志
  2. git reset –hard 版本号(前六位) 切换到任意版本
  3. git reflog 查看分支引用记录,能够查阅所有版本号
  4. git clone –recursive https://xxx.git 将远程代码库克隆到本地
  5. git pull 将远程代码库的变化更新到本地
  6. git push 将本地修改内容推送到远程代码仓库

开发时一般工作流程:

git status 查询当前的文件中状态

git add –all. 将工作区的内容存到暂存区
git add –ignore-removal

git commit -m “版本信息” 暂存区内容提交到本地代码仓库

git push 提交到远程代码仓库

原文地址:https://www.cnblogs.com/coderkl/p/4320297.html