zoukankan      html  css  js  c++  java
  • gitHub初使用

      github以前一直在看别人的项目,今天尝试自己上传项目源码;

      操作步骤:

        1、首先对本地项目进行初始化:git init

        2、项目中添加文件(已有不进行操作);

        3、项目文件全部git到本地仓库 git add -A,文件太多,不展示

        4、git status 提交文件;

        5、提交文件git commit -m "initial commit"对不发生修改的项目文件执行此操作;

        6、本地git与github的关联:分别输入git config --global user.name “用户名”;和git config --global user.email“邮箱”;

        7、生成sshkey: ssh-keygen -t rsa -C "邮箱";

        8、复制生成的ssh文件:  clip < ~/.ssh id_rsa.pub

        9、进入github个人设置界面 settings 找到SSH and GPG keys:复制ssh添加ssh-key,粘贴内容,标题自己随便写;

        10、关联仓库: git remote add origin git@github.com:wittyGIrl/navigators.git(使用ssh地址,https太慢);

        11、测试是否正确连接github: ssh -T git@github.com

        12、最后: git push -u origin master即可;

    ps:踩坑:一、最后push报错 src refspec master does not match any when pushing commits in git;因为没有进行commit操作;所以需要 git commit -m "initial commit",然后

          git push origin master;

        二、没有权限提交文件:尝试是否使用正确邮箱

     

  • 相关阅读:
    使用vs2010编译 Python SIP PyQt4
    谷歌编程指南
    【转】微策略面经相关资料
    KMP 算法
    C++ 拷贝构造函数
    虚继承 虚表 定义一个不能被继承的类
    cache的工作原理
    背包问题
    【转】C/C++ 内存对齐
    【转】 Linux/Unix 进程间通信的各种方式及其比较
  • 原文地址:https://www.cnblogs.com/gehj/p/8809782.html
Copyright © 2011-2022 走看看