美文网首页
git 常用命令

git 常用命令

作者: 非文666 | 来源:发表于2018-05-22 17:18 被阅读0次

用了一段时间的git了,把常用的git做个记录:

  1. git pull (更新代码)
  2. git add . (将代码提交到缓存区)
  3. git commit -m "注释" (将代码由缓存区提交本地分支)
  4. git push (将本地分支内容推送到远程分支)
  5. git merge --no-ff "要合并的分支名" (把要合并的分支合并到当前分支)
  6. git checkout "分支名"(由远程拉取分支)
  7. git checkout -b "新分支名" (新建分支)
  8. git branch -D "分支名"(删除本地分支)
  9. git branch (查看分支)
  10. git push --set-upstream origin wangfei_dispatcher(推送本地分支到远程)
  11. git status 查看分支状态
  12. git reflog 查看git分支版本状态
  13. git reset --hard "版本号"
  14. git stash 不想提交代码,将代码暂存
  15. git stash pop从暂存区获取代码

相关文章

网友评论

      本文标题:git 常用命令

      本文链接:https://www.haomeiwen.com/subject/xahkjftx.html