Github如何上传代码?

第一步:创建Github新账户

第二步:新建仓库

第三部:填写名称,简介(可选),勾选Initialize this repository with a README选项,这是自动创建REAMDE.md文件,省的你再创建。

第四步:安装Github shell程序,地址:http://windows.github.com/

第五步:打开Git Shell,输入以下命令生成密钥来验证身份

ssh-keygen -C 'your@email.address' -t rsa

连续三个回车之后会在windows当前用户目录下生成.ssh文件夹,和linux一样。

把文件夹下的id_rsa.pub文件内容全部复制。

然后打开github账户设置,如图

打开ssh keys


右上角点击add ssh key

然后在title随便输入,key栏粘贴刚才的密钥。

第六步:在Git Shell下输入命令测试刚才的公钥是否认证正确。

ssh -T git@github.com

正确结果会显示:

Warning:Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.

Hi Flowerowl! You've successfully authenticated, but GitHub does not provide shell access.

warning 不用理会。

第七步:clone刚才新建的repository 到本地,输入命令:

git clone https://github.com/Flowerowl/stumansys.gitgit@github.com:username/hello.git

这时会在目录下生成:

第八步:将想上传的代码目录拷贝到此文件夹下:

第九步:切换到Git shell 命令行下,输入命令:

git init

git commit -m 'stumansys'

git remote add origin git@github.con:usernam/hello.git

git push origin master

在执行git push origin master时,报错:

error:failed to push som refs to.......

则执行以下语句:

git pull origin master

先把远程服务器github上面的文件拉先来,再push 上去。

Github如何上传代码?的更多相关文章

  1. github客户端上传代码

    在window下安装github客户端上传代码 第一步:创建Github新账户 第二步:新建仓库 第三步:安装Github shell程序,地址:http://windows.github.com/ ...

  2. github从上传代码到发布静态网站

    1.上传代码 第一步:建立git仓库 cd到你的本地项目根目录下,执行git命令 git init 第二步:将项目的所有文件添加到仓库中 git add . 如果想添加某个特定的文件,只需把.换成特定 ...

  3. 201709012工作日记--一台电脑创建两个Github账户上传代码

    1. 在一台主机上面使用多个GitHub账号 有时候,我们需要将个人账号和公司账号区分,这时候我们就会需要在一台电脑上使用2个不同的git账号. 2. 上传文件 http://blog.csdn.ne ...

  4. github如何上传代码

    别人写的太好了,没必要重写.备份给自己参看. 1.https://www.cnblogs.com/zlxbky/p/7727895.html 2.https://blog.csdn.net/pql92 ...

  5. 【iOS 使用github上传代码】详解

    [iOS 使用github上传代码]详解 一.github创建新工程 二.直接添加文件 三.通过https 和 SSH 操作两种方式上传工程 3.1https 和 SSH 的区别: 3.1.1.前者可 ...

  6. 使用webstom或者idea上传代码到github或coding

    鉴于github网络速度太慢,建议用coding.先介绍github上传方式,因为webstom或idea集成了github,方法简单. git是一个版本控制器,他的作用是管理代码.比如你修改了代码, ...

  7. linux 下向github上传代码

    上传代码: cd TPS/devices/M8 git init                      #//初始化 git add .                    #如果是.表示上传全 ...

  8. windows上传代码到github

    上传代码到github上有很多种方法,在这里我介绍一种比较简单的一种.工具嘛,越简单越好用啊. 1.首先下载github在windows下的客户端 下载地址:https://desktop.githu ...

  9. Github上传代码菜鸟超详细教程【转】

    最近需要将课设代码上传到Github上,之前只是用来fork别人的代码. 这篇文章写得是windows下的使用方法. 第一步:创建Github新账户 第二步:新建仓库 第三部:填写名称,简介(可选), ...

随机推荐

  1. 第三章:ES分词简单说明

    1. Index_Analyzer为索引时使用的分词器,search_Analyzer为搜索时使用的分词器 这个索引,对应的数据是下图: 数据格式是用%分隔的年份,"index_analyz ...

  2. .NET-MVC添加属性验证

    属性验证 //验证字段必输入 [Required(ErrorMessage="用户名必须填写")] //字段长度限制 [MinLength(,ErrorMessage=" ...

  3. (LeetCode 160)Intersection of Two Linked Lists

    Write a program to find the node at which the intersection of two singly linked lists begins. For ex ...

  4. zookeeperclient代码解读

    近期一直在忙WebPageTest(下面简称wpt)开源库的改动工作,当中一项工作须要将zookeeper(下面简称zk)集成到wpt里. zk作为分布式系统的同步工具.实现了写的原子性(要么失败.要 ...

  5. Android actionBar与Fragment结合使用Demo2

    上一篇文章介绍了ActionBar的使用,这里介绍ActionBar的还有一种用法.达到的效果和曾经的GroupActivity或TabHost是一样的,可作为导航来使用. 实现效果图: 源码: 布局 ...

  6. solr安装使用笔记

    下载 solr官方下载地址:http://lucene.apache.org/solr/ 使用 启动 solr dir/bin/solr.cmd start 停止 solr dir/bin/solr. ...

  7. CheeseZH: Stanford University: Machine Learning Ex2:Logistic Regression

    1. Sigmoid Function In Logisttic Regression, the hypothesis is defined as: where function g is the s ...

  8. 调整UIPickerView高度

    Advantages: Makes setFrame of UIPickerView behave like it should No transform code within your UIVie ...

  9. uva 10721 - Bar Codes(dp)

    题目链接:uva 10721 - Bar Codes 题目大意:给出n,k和m,用k个1~m的数组成n,问有几种组成方法. 解题思路:简单dp,cnt[i][j]表示用i个数组成j, cnt[i][j ...

  10. SVN、TortoiseSVN相关问题

    主要记录一些日常操作出现的问题: 1.upgrade working copy: SVN客户端升级或降级的时候,在本地已经下载workspace右键会显示upgrade working copy. 无 ...