zoukankan      html  css  js  c++  java
  • git基础命令学习总结

    1. git版本升级
      git clone git://git.kernel.org/pub/scm/git/git.git

    2. 列出所有 Git 当时能找到的配置
      git config --list
      git config <key>: 来检查 Git 的某一项配置

    3. 使用 Git 来对现有的项目进行管理
      git init

    4. 克隆远程仓库
      git clone [url]

    5. 查看文件状态 $ git status

    6. git add readme.md把修改添加到暂存区
      从暂存区中删除 git rm --cached readme.md
      提交更新代码
      git commit -m "test"

    7. 查看提交历史git log
      git status查看git仓库的状态

    8. 查看已配置的远程仓库服务器
      git remote
      git remote -v
      会显示需要读写远程仓库使用的 Git 保存的简写与其对应的 URL。如果你的远程仓库不止一个,该命令会将它们全部列出。

    9. 添加一个新的远程 Git 仓库,同时指 定一个你可以轻松引用的简写。
      git remote add <shortname> <url>
      现在你可以在命令行中使用字符串 pb 来代替整个 URL。 例如,如果你想拉取 Paul 的仓库 中有但你没有的信息,可以运行 git fetch pb

    10. 移除一个远程仓库 git remote rm test1

    11. 创建新分支 git branch testing
    12. 查看各个分支当前所指的对象 git log --oneline --decorate
      输出你的提交历史、各个分支的指向以及项目的分支分叉情况:git log --oneline --decorate --graph --all
    13. 切换到一个已存在的分支 git checkout testing
      新建一个分支并 同时切换到那个分支上:git checkout -b buging
    14. 合并分支:git merge buging
    15. 删除分支:git branch -d buging
      删除远程分支:git push origin --delete buging
    16. 查询当前所有分支: git branch
      查看每一个分支的最后一次提交:git branch -v
      查看哪些分支已经合并到当前分支: git branch -merged
      查看所有包含未合并工作的分支: git branch --no-merged
    17. 给代码加上标签:git tag v1.0
    18. 查看所有标签:git tag
    19. 切换到指定版本代码git chechout v1.0
    20. 这里写图片描述
  • 相关阅读:
    40.lombok在IntelliJ IDEA下的使用
    39.Intellij导入子项目时,maven列表子项目灰色不可用---解决方法
    38.IntelliJ IDEA中创建Web聚合项目(Maven多模块项目)
    Log4j.properties 属性详解以及 LOG4J日志级别详解
    3.lombok系列3:lombok的实验类特性
    2.lombok系列2:lombok注解详解
    1.lombok系列1:初识lombok
    DIV和SPAN的区别
    37.Intellij IDEA解决GBK乱码
    WebService三大基本元素 SOAP WSDL UDDI
  • 原文地址:https://www.cnblogs.com/zbokett/p/8370531.html
Copyright © 2011-2022 走看看