使用git如何下载github上的代码到本地

  1. cd 到本地目录,使用git init 命令初始化git

    git init
    
  2. 添加github远程代码仓库

    //命令:git remote add origin + 远程代码仓库地址
    
    eg:git remote add origin https://github.com/zhangdaiscott/jeecg-boot.git
    
  3. 下载远程仓库代码

    //命令:git clone + 远程代码仓库地址
    eg:git clone https://github.com/zhangdaiscott/jeecg-boot.git
    
  4. 拉取最新代码(不合并本地代码)

    eg:git fetch
    
原文地址:https://www.cnblogs.com/cnbzys/p/12144715.html