zoukankan      html  css  js  c++  java
  • 利用命令行将本地代码上传至GitHub仓库

    > 以下就是用命令行方式上传代码到github上的技巧

     

    1. 建立git仓库
    cd到你的本地项目根目录下,执行git命令

    `git init`

     

    2. 将项目的所有文件添加到仓库中

    `git add .`

    如果想添加某个特定的文件,只需把.换成特定的文件名即可

     

    3. 将add的文件commit到仓库

    `git commit -m` "对上传的内容进行解释,原则上可以写任意东西"

     

    4. 去github上创建自己的Repository

    5. 这一步是重点,将本地的仓库关联到GitHub上

    `git remote add origin https://github.com/shuoqiu/zhidao-film`

    后面的https链接地址换成你自己的仓库url地址.

     

    6. 上传GitHub之前,要先pull一下,执行如下命令:

    `git pull --rebase origin master`

    7. 最后一步,上传代码到GitHub远程仓库

    `git push -u origin master`

     

    执行完后,如果没有异常,等待执行完就上传成功了,中间可能会让你输入Username和Password,

    你只要 输入github的账号和密码就行了

  • 相关阅读:
    使用Debug Diagnostic Tool排除内存泄漏故障
    Windows下实现应用程序看门狗软件
    linux教程:[3]配置Zookeeper开机启动
    设置zookeeper为systemctl守护进程
    Dr. Memory Quickstart Instructions in Chinese
    Windows Server2008R2,ServerWin2012 R2设置自动登录注册表配置
    Nacos 解读:服务发现客户端
    FeignClient注解及参数
    MySQL自动设置create_time和update_time
    LocalDate、LocalTime、LocalDateTime 和mysql交互
  • 原文地址:https://www.cnblogs.com/YKiOS/p/6283669.html
Copyright © 2011-2022 走看看