zoukankan      html  css  js  c++  java
  • 本地代码上传GitHub

    0. 登录

    git config --global user.name "GitHub用户名"
    git config --global user.email "GitHub登录邮箱"
    

    1. 在目录中创建新的 Git 仓库

    git init
    

    2. 关联远程库

    git remote add origin 仓库地址
    


    3. 添加文件到本地库

    git add .
    

    4. 添加日志

    git commit -m '自定义'
    

    5. 拉取代码到本地

    git pull origin master --allow-unrelated-histories
    git pull origin master
    

    有共同文件的使用第一句,没有的话使用第二句。如果没有执行这句的话直接推代码到远程库,可能会报错。报错内容如下:

    6. 推送代码到远程库

    git push -u origin master
    

    7. 用户名和邮箱地址

    在使用过程中可能会弹出输入用户名邮箱的窗口,输入自己的 GitHub 用户名和邮箱即可

  • 相关阅读:
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    Document
    8.React 组件封装
    window.location / history / 以及相关事件
  • 原文地址:https://www.cnblogs.com/Lin1031/p/14339554.html
Copyright © 2011-2022 走看看