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.pswp.cn/news/278178.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278178.shtml
英文地址,請注明出處:http://en.pswp.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的控制中心內…