zoukankan      html  css  js  c++  java
  • git基本操作

    拉取带有 子模块

    
    git clone --recurse-submodules https://github.com/chaconinc/MainProject
    
    如果你已经克隆了项目但忘记了 --recurse-submodules,
    那么可以运行 git submodule update --init 将 git submodule init 和 git submodule update 合并成一步。
    如果还要初始化、抓取并检出任何嵌套的子模块, 请使用简明的 git submodule update --init --recursive。
    

    清理修改 还原默认

    
    git fetch --all
    git reset --hard origin/master
    git pull
    
    git reset --hard HEAD
    git clean -i
    
    建议先在别处练习下再用
    git reset --hard
    git clean -dfx
    包干净
    撤销还未提交的内容: git checkout -- XXX/XXX/XXX
    撤销全部的未提交的内容: git reset --hard HEAD
    

    git 分支查看与切换

    # 1.查看所有分支
    > git branch -a
    
    # 2.查看当前使用分支(结果列表中前面标*号的表示当前使用分支)
    > git branch
     
    # 3.切换分支
    > git checkout 分支名
    

    添加子模块

    
    //第一步,初始化
    git init 
    
    //第二步,拉取,后面推荐使用ssh地址
    git submodule add (+地址)
    ------
    git submodule updata --init --recursive    下拉子模块
     
    
     
    
    --------------------
    
    报错:
    
    fatal: not a git repository (or any of the parent directories): .git
    原因:没有初始化
    
    解决:
    
    git init
    
  • 相关阅读:
    Yarn Client 模式
    K8S & Mesos 模式
    python_切片
    RDD执行原理
    基础编程
    python_html模板
    python_返回值
    python_机器学习_平均中位数模式
    VISIO下载+安装+第一个数据流图
    session对象
  • 原文地址:https://www.cnblogs.com/marklove/p/12951261.html
Copyright © 2011-2022 走看看