zoukankan      html  css  js  c++  java
  • git常用命令汇总

    1. 创建版本库 git init

    2. 添加当前目录所有的文件到索引 git add .

    3. 添加指定文件到索引 git add readme.txt

    4. 提交到本地源码库,并附加提交注释 git commit -m "first commit"

    5. 查看状态 git status

    6. 查看文件变化 git diff readme.txt

    7. 版本回退,回退到上一版本 git reset --hard HEAD^  回退到上上版本 git reset --hard HEAD^^  回退到往上100个版本 git reset --hard HEAD~100

    8. 版本还原 git reset --hard 10095adb(commit id)

    9. 查看记录 git reflog

    10. 查看分支 git branch

    11. 创建分支 git branch test(分支名)

    12. 切换分支 git checkout test(分支名)

    13. 删除分支 git branch -d test(分支名)

    14. 查看提交历史 git log

    15. 恢复修改前状态 git checkout --readme.txt(文件名)

    16. 打开可视化界面 gitk

    17. 从远程仓库拉取最新 git pull

    18. 将本地代码推到远程仓库 git push

  • 相关阅读:
    CF Spreadsheets (数学)
    CF Theatre Square
    CF Error Correct System
    CF Playing with Paper
    HDU 3533 Escape (BFS + 预处理)
    nginx配置文件
    nginx配置文件详解
    Jenkins+maven+gitlab+shell实现项目自动化部署
    jenkins升级
    jenkins相关下载链接
  • 原文地址:https://www.cnblogs.com/zhchsh/p/9173507.html
Copyright © 2011-2022 走看看