Github如何上传代码?
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如何上传代码?的更多相关文章
- github客户端上传代码
在window下安装github客户端上传代码 第一步:创建Github新账户 第二步:新建仓库 第三步:安装Github shell程序,地址:http://windows.github.com/ ...
- github从上传代码到发布静态网站
1.上传代码 第一步:建立git仓库 cd到你的本地项目根目录下,执行git命令 git init 第二步:将项目的所有文件添加到仓库中 git add . 如果想添加某个特定的文件,只需把.换成特定 ...
- 201709012工作日记--一台电脑创建两个Github账户上传代码
1. 在一台主机上面使用多个GitHub账号 有时候,我们需要将个人账号和公司账号区分,这时候我们就会需要在一台电脑上使用2个不同的git账号. 2. 上传文件 http://blog.csdn.ne ...
- github如何上传代码
别人写的太好了,没必要重写.备份给自己参看. 1.https://www.cnblogs.com/zlxbky/p/7727895.html 2.https://blog.csdn.net/pql92 ...
- 【iOS 使用github上传代码】详解
[iOS 使用github上传代码]详解 一.github创建新工程 二.直接添加文件 三.通过https 和 SSH 操作两种方式上传工程 3.1https 和 SSH 的区别: 3.1.1.前者可 ...
- 使用webstom或者idea上传代码到github或coding
鉴于github网络速度太慢,建议用coding.先介绍github上传方式,因为webstom或idea集成了github,方法简单. git是一个版本控制器,他的作用是管理代码.比如你修改了代码, ...
- linux 下向github上传代码
上传代码: cd TPS/devices/M8 git init #//初始化 git add . #如果是.表示上传全 ...
- windows上传代码到github
上传代码到github上有很多种方法,在这里我介绍一种比较简单的一种.工具嘛,越简单越好用啊. 1.首先下载github在windows下的客户端 下载地址:https://desktop.githu ...
- Github上传代码菜鸟超详细教程【转】
最近需要将课设代码上传到Github上,之前只是用来fork别人的代码. 这篇文章写得是windows下的使用方法. 第一步:创建Github新账户 第二步:新建仓库 第三部:填写名称,简介(可选), ...
随机推荐
- (转)Unity中武器与人物的碰撞检测
自:http://blog.csdn.net/Monzart7an/article/details/24435843 目前来说有三种思路,其实前两种算变种了: 1.动画关键帧回调 + 范围检测. 这个 ...
- 用Bluepages来验证intranetId和Password的有效性
代码很简单,如下: int ret = -1;ReturnCode rc = null; cwa2 cw = new cwa2();rc = cw.authenticate(in ...
- Android动态设置字体颜色
步骤: 1.在values目录下的strings.xml文件中加入颜色:比方 <color name="ccc">#ccc</color> 2.假设你直接这 ...
- ubuntu Server 安装 php5
ubuntu Server 安装 php5 1:如果你的服务器已经安装了apache2组件,那么在安装php5时,可以把对应apache2的php5组件一起安装 sudo apt-get instal ...
- 设置tableViewCell背景颜色
1 2 3 4 5 6 7 8 9 10 11 12 13 //方法一: cell.contentView.backgroundColor = [UIColor redColor]; //方法二: U ...
- wepy - 与原生有什么不同(x.wpy)使用实例
源码 <template> <view class='mark' wx:if="{{showMark}}"> <view animation=&quo ...
- vscode - 设置中文语言
记得上次安装的时候,自动提示安装本地语言包,现在的版本貌似不会了吧. 1.先安装扩展,按键CTRL+SHIFT+P 输入 ext install ,最后输入:language,大概就可以找到简体中文包 ...
- 栈的实现实例(C语言)
/* stack.h */ #ifndef _stack_h #define _stack_h struct stack_record; typedef struct stack_record *st ...
- Java面试处理高并发
经过查资料,方案如下所示. 1 从最基础的地方做起,优化我们写的代码,减少必要的资源浪费. a.避免频繁的使用new对象,对于整个应用只需要存在一个实例的类,我们可以使用单例模 ...
- 使用fiddler来抓包
使用fiddler来抓包 Sniffer,wireshark,WinNetCap.WinSock Expert,SpyNet 都是当前流行的抓包工具 需要先做一些简单的准备工作: 一台带有无线网卡的P ...