Git与Github的连接与使用

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

Git与Github的连接与使用

 

下面继续,使用git 将项目上传到GitHub上

首先要有GitHub账号,这就不用说了,没有的先注册,地址:https://github.com 

没有仓库的话,先新创建一个仓库

填写新仓库名称,备注信息。点击创建即可完成。

 

创建完成会显示如下界面。先放置不用管。后面会用到

 

 

因为本地Git仓库和GitHub仓库之间的传输是通过SSH加密传输的,GitHub需要识别是否是你推送,GitHub只要知道了你的公钥,就可以确认只有你自己才能推送,所以需要配置ssh key。

1.创建SSH Key。

在用户主目录(C:\Users\Administrator)下,看看有没有.ssh文件,如果有,再看文件下有没有id_rsaid_rsa.pub这两个文件,如果已经有了,可直接到下一步。如果没有,打开Git Bash,输入命令,创建SSH Key

1

$ ssh-keygen -t rsa -C "123@126.com" //123 是你自己注册GitHub的邮箱

直接回车就哦了

出现上图,就说创建成功啦,再去用户主目录里找到.ssh文件夹,里面有id_rsaid_rsa.pub两个文件,这两个就是SSH Key的秘钥对,id_rsa是私钥,不能泄露,id_rsa.pub是公钥,可以公开。

 

2.接下来到GitHub上,打开“Account settings”--“SSH Keys”页面,然后点击“Add SSH Key”,填上Title(随意写),在Key文本框里粘贴 id_rsa.pub文件里的全部内容。

点“Add Key”,你就应该看到已经添加的Key,可以添加多个Key

 

3.验证是否成功,在git bash里输入下面的命令

1

$ ssh -T git@github.com

如果初次设置的话,会出现如下界面,输入yes 同意即可

4.下面开始设置username和email,因为github每次commit都会记录他们

1

2

$ git config --global user.name  "name"//你的GitHub登陆名

$ git config --global user.email "123@126.com"//你的GitHub注册邮箱

5.接下来就是把本地仓库传到github上去,之前在GitHub上建好一个新的仓库是,跳转的页面,完全按照上面的只是操作就可以了。

 

1

2

$ git remote add origin git@github.com:flora0103/example.git    //关联一个远程库命令, git@github.com:flora0103/example.git   这个是自己远程库

git push -u origin master    //关联后,第一次推送master分支的所有内容命令,此后,每次本地提交后,就可以使用命令g

转载于:https://my.oschina.net/u/3318187/blog/1791222

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/278178.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

ttl电路制作pong游戏_如何玩Mozilla Firefox的隐藏的独角兽Pong游戏

ttl电路制作pong游戏It seems like every browser has a hidden game these days. Chrome has a dinosaur game, Edge has surfing, and Firefox has . . . unicorn pong? Yep, you read that right—here’s how to play it. 这些天似乎每个浏览器都有一个隐藏的游戏。 Chrom…

nginx 注释配置及详解

前言 DMZ(Demilitarized Zone) 非军事区,生产环境 WEB 服务部署的区域,公司的架构为一台nginx 充当 load balance 服务,负载到两台 nginx 上面,反向代理至后台服务,但是nginx 用的全是默认配置加上 proxy_pass 和 upst…

为什么无法运行谷歌play_什么是Google Play积分,以及如何使用它们?

为什么无法运行谷歌playThe Google Play Store is home to thousands of apps, games, movies, e-books, and more. You might find yourself making a lot of purchases there, so why not get rewarded for it? That’s where Google Play Points come in. Google Play商店提…

2019年春季学期第三周作业

本周作业 本周请大家完成上周挑战作业的第一部分:给定一个整数数组(包含正负数),找到一个具有最大和的子数组,返回其最大的子数组的和。 例如:[1, -2, 3, 10, -4, 7, 2, -5]的最大子数组为[3, 10, -4, 7, 2] 1).实验代…

Linux实验二:linux 常用命令练习

ls命令 列出目录内容 echo命令 显示字符串 date命令 显示或设置系统的日期与时间 cal命令 显示日历 who命令 列出登录用户信息 chown命令 chgrp命令 改变文件所属的用户组 chmod命令 改变文件访问权限 find命令 在目录中搜索文件 转载于:https://www.cnblogs.com/nullno/p/87…

python数据类型之元组类型

#为何要有元组&#xff0c;存放多个值&#xff0c;元组不可变&#xff0c;更多的是用来做查询 t(1,[1&#xff0c;2,3],a,(1,2)) #ttuple((1,[1,2,3],a,(1,2))) # print(type(t)) <class tuple># #元组可以作为字典的key # d{(1,2):egon} # print(d,type(d),d[(1,2)])# …

短语密码_使用密码短语以提高安全性

短语密码Did you know that Windows supports using passwords of up to 127 characters? I don’t use passwords anymore, and I haven’t for years. I’ve switched to using password phrases instead. 您知道Windows支持使用最多127个字符的密码吗&#xff1f; 我不再使…

「单点登录与权限管理」系列概述

首先&#xff0c;感谢几位朋友在朋友圈转发我的文章&#xff0c;小声的告诉你们&#xff0c;是我主动让他们帮忙转发的&#xff1a;&#xff09;在朋友们的分享下&#xff0c;凌晨推送的一篇文章&#xff0c;阅读人数达到了280多&#xff0c;很满足&#xff0c;我会坚持写下去&…

Jupyter notebook: TypeError: __init__() got an unexpected keyword argument 'io_loop 问题

使用环境&#xff1a;Anaconda3&#xff08;Python3.6&#xff09; 创建一个新的notebook时&#xff0c;无法连接到kernel&#xff0c;terminal上显示错误为&#xff1a;TypeError: __init__() got an unexpected keyword argument io_loop 解决方法&#xff1a; conda install…

在Ubuntu Linux中获取上次访问的文件时间

Ubuntu Linux has a rich set of commands for manipulating and accessing files. The stat utility gives detailed access to file information, including last accessed and last modified file time. Ubuntu Linux具有一组丰富的用于操作和访问文件的命令。 stat实用程序…

MySQL新增从库

项目背景描述&#xff1a;在项目的开始只有一个MySQL实例在运行&#xff0c;后期因为安全性&#xff0c;压力&#xff0c;备份等原因需要在此实例的基础上面新增一个从库。分析&#xff1a;MySQL主从是基于binlog日志来实现的&#xff0c;那么需要主服务器开启binlog&#xff0…

第一个议题

① 在每个问题后面&#xff0c;请说明哪一章节的什么内容引起了你的提问&#xff0c;提供一些上下文 ② 列出一些事例或资料&#xff0c;支持你的提问 。 ③ 说说你提问题的原因&#xff0c;你说因为自己的假设和书中的不同而提问&#xff0c;还是不懂书中的术语&#xff0c;还…

在Windows Vista中使用符号链接

One of the long-awaited features in Windows Vista was the ability to use symbolic links, the way you can in linux. Sadly, they don’t work quite as well as they could, but it’s a big upgrade from prior versions, and has solved a number of problems for me …

shell学习笔记--自我总结

一、文件 touch file # 创建空白文件 rm -rf 目录名 # 不提示删除非空目录(-r:递归删除 -f强制) dos2unix # windows文本转linux文本 unix2dos # linux文本转windows文本 enca filename # 查看编码 安装 yu…

201671030107胡文艳实验三作业互评与改进报告

任务1&#xff1a;要给出所点评作业的链接地址&#xff0c;点评内容和阅读心得 读了你的这篇博客&#xff0c;一方面给我的印象就是排版整齐&#xff0c;内容充实&#xff0c;态度认真&#xff1b;另外一方面就是通过别人反省自己&#xff0c;看了你的博客&#xff0c;我觉得我…

进程handle获取线程_获取进程中的线程列表

进程handle获取线程The System.Diagnostics namespace contains functions that allow you to manage processes, threads, eventlogs and performance information. System.Diagnostics命名空间包含允许您管理进程&#xff0c;线程&#xff0c;事件日志和性能信息的函数。 The…

2018-3-28Linux系统管理(16)计算机网络基础

在这一章当中我们讲述计算机网络基础。一、计算机网络网络通信就像人与人之间的交流一样&#xff0c;说同一种语言&#xff0c;而后双方进行无障碍的通信交流&#xff0c;那么两台主机通信时&#xff0c;它们彼此交换数据的格式的前提为互相理解才可以&#xff0c;我们此前也有…

从Ubuntu命令行按进程名称杀死进程

There are a number of ways to kill a process if you know the name of the process. Here’s a couple different ways you can accomplish this. We are going to assume that the process we are trying to kill is named irssi 如果您知道进程的名称&#xff0c;则有多种…

18 南京 D

裸的最小球覆盖。 坐标范围大一些所以我们把初始的温度也设置的大一些。 1 #include <bits/stdc.h>2 using namespace std;3 typedef long long ll;4 typedef double db;5 const db INF 1e100;6 const db delta 0.98;7 const db eps 1e-8;8 struct p3{9 db x,y,z;…

如何在iPhone或iPad的控制中心中控制智能家居设备

Apple’s Home app offers quick controls for controlling smart lights, doorbells, thermostats, and other smart home devices—right in your iPhone or iPad’s Control Center. Here’s how to set it up and use it. Apple的Home应用程序可在iPhone或iPad的控制中心内…