zoukankan      html  css  js  c++  java
  • 如何更新GitHub上的代码?

    更新github上的代码

    一、克隆代码

    1、先是把自己GitHub上的代码克隆到本地(下载到本地)

    步骤1.随便创建一个新文件夹(用来存放下载下来的代码)

    步骤2.在文件夹中打开cmd

    输入下载指令下载自己在GitHub上的profile

    git clone https://github.com/CSwuyp/socket.git//后面这个是你的GitHub上profile的地址
    

      

     备注:这里的克隆代码有两种方式,一种是上面的方法,另外一种是直接到GitHub上把对应的profile下载下来然后后面的操作都是一样的

    二、git status查看状态
    1、查看当前的git仓库状态,可以使用git status

    git status

    2、如果是在刚才新建的文件夹输入git status 会提示你git目录不对
    3、先用cd命令切换到socket这个repository目录
    4、再输入git status可以看到On branch master,这个说明已经在master分之上了

    三、更新代码
    1、在socket文件夹下更细东西,比如我想更新之前已经在GitHub上有的项目文件,此时我只需要把文件替换成新的就可以了

    2、更新后使用git add * --代表更新全部

    git add *
    

    3、接着输入git commit -m "更新说明",commit只是提交到缓存区域

    git commit -m "update”
    

     

    4、如果多人同时开发维护代码,得先git pull,拉取当前分支最新代码

    git pull
    

      

    5、最后git push origin master,最后一步才是push到远程master分支上

    这里因为我们还没有说明我们要上传到哪个GitHub上所以会任务中断然后让你先输入要上传的帐号之后才能继续上传

    上传成功后会我们就会看到在GitHub上对应的profile会更新,而且我们前面的更新说明写的是update也会出现在这里

  • 相关阅读:
    max key length is 1000 bytes
    205 Reset Content
    The Path Attribute
    track message forwards, avoiding request loops, and identifying the protocol capabilities of all senders along the request/response chain
    test hypertext links for validity, accessibility, and recent modification
    ES6 will change the way you write JS code.
    ECMAScript Web APIs node.js
    Symbols
    HTML/Elements/base
    frag General URL components
  • 原文地址:https://www.cnblogs.com/wuyepeng/p/9747304.html
Copyright © 2011-2022 走看看