zoukankan      html  css  js  c++  java
  • Git使用方法

    指令注释
    git init 初始化
    git config --global user.name "姓名" 配置姓名
    git config --global user.email "邮箱" 配置邮箱
    git add ./ 添加到待提交
    git commit -m "注释" 提交修改
    git reset --hard head~0 回退
    git reset --hard 版本号 回退到指定版本号
    git log 查看日志
    git log --oneline 查看精简日志
    git reflog 查看以前的所有分支、[版本号]
    git branch 分支名 新建分支
    git branch 查看分支
    git checkout 分支名 切换分支
    git merge 分支名 合并分支
    git push [地址] 分支名 上传到git服务器
    git pull [地址] 分支名 从git服务器下载
    git clone [地址] 从git服务器克隆所有,会新建文件夹覆盖
    git branch -d 分支名 删除分支
    git status 查看当前文件状态
    git remote add [变量名] [远程地址] 将远程地址添加到变量
    git push/pull -u 分支名 和远程服务器分支关联
    ssh-keygen -t rsa -C "邮箱" 生成ssh公钥和私钥

    git remote -v    查看所有变量

    git remote remove origin  删除指定变量

    * 合并分支只会修改当前分支

     

    git merge 分支名 --squash   合并代码

     

  • 相关阅读:
    省选模拟25
    有关树链剖分
    有关矩阵的一点讨论
    洛谷 P3390 【模板】矩阵快速幂
    HDU P2089
    有关动态规划(主要是数位DP)的一点讨论
    HDU P2222 Keywords Search
    普通平衡树Tyvj1728、luogu P3369 (treap)
    POJ P2104 K-th Number
    POJ 3311Hie with the Pie
  • 原文地址:https://www.cnblogs.com/lv77/p/14008142.html
Copyright © 2011-2022 走看看