Git 常用命令 和 安装

  这年头不会点git还真不能与别人进行代码交流

 

 ps: 如上图就是git的工作流程图

  

  git add file   # 将file加入暂存区
  git commit -m '创建hello.txt'   # 提交到仓库 后面是说明
 
  git log     # 查看历史记录
  git status    # 查看暂存区信息

  git reset HEAD^^^   # 将仓库回到缓存中 ^是要恢复的版本 最近HEAD
  git checkout hello.txt   # 将缓存中把hello.txt的数据恢复回来

  git pull      # 从GitHub下拉到本地
  git push origin master    # 从仓库上传到GitHub

 

猜你喜欢

转载自www.cnblogs.com/taozhengquan/p/10122213.html