在window下安装github客户端上传代码

第一步:创建Github新账户

第二步:新建仓库

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

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

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

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

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

$ ssh -T git@github.com

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

 git clone https://github.com/XXXXX/XXXXXX.git

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

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

git init

git add .

git commit -m 'xxxxxx'

git remote add origin https://github.com/xxxxx/xxxxx.git

git push origin master

(1)如果执行git remote add origin https://github.com/xxxxx/xxxxx.git,出现错误:

fatal:remote origin already exists 

则执行以下语句:

git remote rm origin

再往后执行git remote add origin https://github.com/xxxxx/xxxxx.git即可。

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

$    git push origin master
To https://github.com/qq20707/DesignPatterns.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/qq20707/DesignPatterns.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

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

则执行以下语句:git pull --rebase origin master

(3)如果出现错误 “refusing to merge unrelated histories”

git pull origin master --allow-unrelated-histories

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

 

github客户端上传代码的更多相关文章

  1. 本地项目通过github客户端上传到github网站上

    一.github客户端上传步骤 一.github客户端上传步骤1.百度搜索关键字: GitHub 离线安装包 ==> Github_3.3.4.0版本链接:https://pan.baidu.c ...

  2. Github如何上传代码?

    Github如何上传代码? 第一步:创建Github新账户 第二步:新建仓库 第三部:填写名称,简介(可选),勾选Initialize this repository with a README选项, ...

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

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

  4. 使用github客户端上传文件(瓜皮教程)

    因为栋哥的课才接触道github这个东西,离第一次接触大概有一年左右了吧,记得不是太清楚了,但是,直到前几天前我还是不知道如何配置,利用git上传文件,之前也是叫同学帮忙弄得,但是这次软工实践要频繁用 ...

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

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

  6. github如何上传代码

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

  7. windows上传代码到github

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

  8. Git安装与上传代码至Github

    转载请注明出处:http://www.cnblogs.com/cnwutianhao/p/6642887.html 这篇文章应该是全网最新,最全,最靠谱的Github安装到上传代码的流程. 1.Git ...

  9. 如何用git上传代码到github详细步骤

    注册账户 这个小菜鸟带着心跳写的第一篇博客! 还请大家多多提点! 想使用github,第一步肯定是要注册github账号,有了账号就是直接登录啦 可以直接打开http://github.com页面注册 ...

随机推荐

  1. CentOS7.2配置vsftpd

    环境 CentOS7.2 (安装镜像CentOS-7-x86_64-DVD-1611) 本文默认使用root用户操作 目标 实现CentOS7.2上安装vsftpd,使用新创建的ftpuser用户便可 ...

  2. android发短信,打电话

    //1.进入系统短信列表界面 Intent intent = newIntent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_DEF ...

  3. CentOS7.1.x+Druid 0.12 集群配置

    原文转载自:https://blog.csdn.net/bigtree_3721/article/details/79583008 先决条件:安装版本列表 本次安装满足下面的条件: CentOS v7 ...

  4. 万恶之源 - Python文件操作

    文件操作 初始文件操作 使用Python来读写文件是非常简单的操作,我们使用open()函数来打开一个文件,获取到文件句柄,然后通过文件句柄就可以进行各种各样的操作了 根据打开方式的不同能够执行的操作 ...

  5. 2.keras实现-->字符级或单词级的one-hot编码 VS 词嵌入

    1. one-hot编码 # 字符集的one-hot编码 import string samples = ['zzh is a pig','he loves himself very much','p ...

  6. 20165324 《网络对抗技术》week1 Kali的安装与配置

    20165324 <网络对抗技术>week1 Kali的安装与配置 安装过程 VMware安装过程省略 kali 光盘映像文件的下载 新建虚拟机,并导入. 安装Tools 在菜单中,选择虚 ...

  7. python的三种字符串格式化方法

    1.最方便的 print 'hello %s and %s' % ('df', 'another df') 但是,有时候,我们有很多的参数要进行格式化,这个时候,一个一个一一对应就有点麻烦了,于是就有 ...

  8. .net 调用API并解析Json数据方法

    using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using Syst ...

  9. Spring Security中异常上抛机制及对于转型处理的一些感悟

    在使用Spring Security的过程中,我们会发现框架内部按照错误及问题出现的场景,划分出了许许多多的异常,但是在业务调用时一般都会向外抛一个统一的异常出来,为什么要这样做呢,以及对于抛出来的异 ...

  10. 修改MySQL数据库中表和表中字段的编码方式的方法

    今天向MySQL数据库中的一张表添加含有中文的数据,可是老是出异常,检查程序并没有发现错误,无奈呀,后来重新检查这张表发现表的编码方式为latin1并且原想可以插入中文的字段的编码方式也是latin1 ...