zoukankan      html  css  js  c++  java
  • 如何把本地的项目推送到github上面去

     前题:本地已经建好了项目,但电脑上没有安装git  (windows 系统)

    1、首页从网上下载git 并安装。

    2、进入项目所在的文件夹,右键鼠标

      3、新建.gitignore文件

            touch .gitignore

            打开.gitignore 文件,填写要忽略的文件  如:

            

      4、把所有本地文件提交

           git add .   //添加到缓存区

           git commit -m "local file add "   //提交 仓库

     5、打开 github.com 网站,并创建仓库 xx.git

     6、把本地的仓库关联到github.com 上面

         $ git remote add origin https://github.com/sci99coder/vuetodo.git

     7、上传github之前要先pull 一下,再执行如下命令

         git pull origin master

     8、最后一下,上传代码到github.com 

         git push -u origin master

        注:如果执行代码后出现如下错误

           

           则执行  

              $ git pull origin master --allow-unrelated-histories  就没有问题了,再提交一次就可以了。

       

            

            

  • 相关阅读:
    1023. 组个最小数
    1021. 个位数统计
    *1020. 月饼
    *1019. 数字黑洞
    1016. 部分A+B
    *1014. 福尔摩斯的约会
    *1013. 数素数
    *1012. 数字分类
    1011. A+B和C
    *1008. 数组元素循环右移问题
  • 原文地址:https://www.cnblogs.com/coderblog/p/8909258.html
Copyright © 2011-2022 走看看