团队中高频使用的指令

  1. 注册内网用户
  2. 项目管理员拉进项目
  3. 获取权限后,git clone 'url' 项目到本地
  4. 创建自己的项目分支 git branch '分支名'
  5. 开始编码
  6. git clone 默认下载所有分支的代码
  7. git branch -r 查看项目所有分支
  8. git branch -a 查看项目所有远程分支
  9. git checkout ’分支名‘ 切换分支
  10. git branch 打印出所有的分支,以及当前的所在分支
  11. git log 查看提交记录,退出 英文状态下 Q
  12. git reflog 可查看修改记录(包括git reset的回退记录)
  13. git reset --hard{commit id} 回退版本
  14. git stash  //代码放进暂存区(未被commit的代码)
  15. git stash apply 还原
  16. git stash drop 清除最近一次的stash记录
  17. git stash pop 还原并清除最近一次stash
  18. git stash list 查看暂存列表
  19. git stash clear 清空所有stash的记录
  20. git remote -v 显示所有远程仓库
  21. git remote add url 添加一个远程仓库
  22. git remote rm name # 删除远程仓库
  23. git remote rename old_name new_name # 修改仓库名

也可以使用第三方工具 Git小乌龟(https://tortoisegit.org/download/

 

posted on 2022-08-20 10:34  平凡滴人  阅读(15)  评论(0编辑  收藏  举报