GitHub 建立遠程倉庫

終端所有信息:

Last login: Fri Aug 14 08:58:01 on console

wuxiaoyuan:~ lan$ ls -al ~/.ssh

ls: /Users/lan/.ssh: No such file or directory

wuxiaoyuan:~ lan$ mkdir .ssh

wuxiaoyuan:~ lan$ cd /Users/lan/.ssh?

wuxiaoyuan:.ssh lan$ ssh-keygen -t rsa -b 4096 -C "1149779588@qq.com"

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/lan/.ssh/id_rsa):?

Enter passphrase (empty for no passphrase):?

Enter same passphrase again:?

Your identification has been saved in /Users/lan/.ssh/id_rsa.

Your public key has been saved in /Users/lan/.ssh/id_rsa.pub.

The key fingerprint is:

d6:62:85:4f:43:b1:60:4b:85:be:8d:43:3b:48:04:0c 1149779588@qq.com

The key's randomart image is:

+--[ RSA 4096]----+

|? Eo..? +o+. ? ? |

|? ? . .o.= . ? ? |

| ? ? . .o =? ? ? |

|? ? ? . o= . ? ? |

| ? ? . oS=o? ? ? |

|? ? ? .o*..? ? ? |

| ? ? ? ? o ? ? ? |

| ? ? ? ? ? ? ? ? |

| ? ? ? ? ? ? ? ? |

+-----------------+

wuxiaoyuan:.ssh lan$ pbcopy < ~/.ssh/id_rsa.pub

wuxiaoyuan:.ssh lan$ cat id_rsa.pub

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDIUvEB2QI2ygbbnIkbKCBqTq1eYLb+uQV4ZFioNOqF1DNHh7tIFGl5UPEuFL+hqhz4rWANjisEv3zaBgXCgUlFPP9jOy0QlUN03K+nVVWzj++Jte0e3drD1MDwOAyV1ShD6sy8gsQp9mplnUn0QqS3zdlVe2otrSpfGPpPnD5L/Sv7uV27xszv8vJd73p2Wyayn4cIQ3rHmmvdOWbeQbvN54nGZBUFFt6KIdwLAQ0+ZeLCJavYoL8Ts2PsyzzSPmyHWUfneCpPrBY8CDkYQC3tsftt7ouKSNFURx/hU5eDzdAgu20pNUPasAZLk76VedhhijBU2i9P5OyQXtuwraTDDv2ih5rwvXKG7KgSMdA2UALDOtPF/mF2rftWY4XR7YzOXnsT+i4BXEVs+wmQ0JBMAyo05dCVzIVxglMc8ZEmCOATqFEgbtmqu+eX1DzudTSvQWsp8oO/he2J5g895yEKAXadiXB9VJKsL7Alaf2gNcmT+zD2/MakGtZJKvXDA7x99Ll2aWbbUtJkgpl1F6LFm7MrFG5xshj8cx7JMgq8muTcI+NZiW5c2NNA+6I/5zJwqXyUzhc6Ehl0ek4l6E8khedsywhcmgQQjwd3nXbDqQA1+of3ADCIOCGnvS1ARi3lgRTSFVBi+HwN35a3ZP3lWn+sFgkrPsVbBkiNzd9YWw== 1149779588@qq.com

wuxiaoyuan:.ssh lan$ ssh -T git@github.com

The authenticity of host 'github.com (192.30.252.129)' can't be established.

RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.

Are you sure you want to continue connecting (yes/no)??

Host key verification failed.

wuxiaoyuan:.ssh lan$ ssh -T git@github.com

The authenticity of host 'github.com (192.30.252.128)' can't be established.

RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.

Are you sure you want to continue connecting (yes/no)? yes

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

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

wuxiaoyuan:.ssh lan$ cd /Users/lan/Desktop/張三?

wuxiaoyuan:張三 lan$ git clone https://github.com/wusang/lanou02.git

Cloning into 'lanou02'...

remote: Counting objects: 5, done.

remote: Compressing objects: 100% (4/4), done.

remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0

Unpacking objects: 100% (5/5), done.

Checking connectivity... done.

wuxiaoyuan:張三 lan$ git status

fatal: Not a git repository (or any of the parent directories): .git

wuxiaoyuan:張三 lan$ cd /Users/lan/Desktop/張三/lanou02?

wuxiaoyuan:lanou02 lan$ git status

On branch master

Your branch is up-to-date with 'origin/master'.

?

Changes to be committed:

? (use "git reset HEAD <file>..." to unstage)

?

new file: ? lanou02/lanou02.xcodeproj/project.pbxproj

new file: ? lanou02/lanou02.xcodeproj/project.xcworkspace/contents.xcworkspacedata

new file: ? lanou02/lanou02/AppDelegate.h

new file: ? lanou02/lanou02/AppDelegate.m

new file: ? lanou02/lanou02/Base.lproj/LaunchScreen.xib

new file: ? lanou02/lanou02/Base.lproj/Main.storyboard

new file: ? lanou02/lanou02/Images.xcassets/AppIcon.appiconset/Contents.json

new file: ? lanou02/lanou02/Info.plist

new file: ? lanou02/lanou02/ViewController.h

new file: ? lanou02/lanou02/ViewController.m

new file: ? lanou02/lanou02/main.m

new file: ? lanou02/lanou02Tests/Info.plist

new file: ? lanou02/lanou02Tests/lanou02Tests.m

?

wuxiaoyuan:lanou02 lan$ open.

-bash: open.: command not found

wuxiaoyuan:lanou02 lan$ open .

wuxiaoyuan:lanou02 lan$ git add .

wuxiaoyuan:lanou02 lan$ git commit -am "添加了工程"

[master 41b1085] 添加了工程

?13 files changed, 762 insertions(+)

?create mode 100644 lanou02/lanou02.xcodeproj/project.pbxproj

?create mode 100644 lanou02/lanou02.xcodeproj/project.xcworkspace/contents.xcworkspacedata

?create mode 100644 lanou02/lanou02/AppDelegate.h

?create mode 100644 lanou02/lanou02/AppDelegate.m

?create mode 100644 lanou02/lanou02/Base.lproj/LaunchScreen.xib

?create mode 100644 lanou02/lanou02/Base.lproj/Main.storyboard

?create mode 100644 lanou02/lanou02/Images.xcassets/AppIcon.appiconset/Contents.json

?create mode 100644 lanou02/lanou02/Info.plist

?create mode 100644 lanou02/lanou02/ViewController.h

?create mode 100644 lanou02/lanou02/ViewController.m

?create mode 100644 lanou02/lanou02/main.m

?create mode 100644 lanou02/lanou02Tests/Info.plist

?create mode 100644 lanou02/lanou02Tests/lanou02Tests.m

wuxiaoyuan:lanou02 lan$ git push

warning: push.default is unset; its implicit value is changing in

Git 2.0 from 'matching' to 'simple'. To squelch this message

and maintain the current behavior after the default changes, use:

?

? git config --global push.default matching

?

To squelch this message and adopt the new behavior now, use:

?

? git config --global push.default simple

?

When push.default is set to 'matching', git will push local branches

to the remote branches that already exist with the same name.

?

In Git 2.0, Git will default to the more conservative 'simple'

behavior, which only pushes the current branch to the corresponding

remote branch that 'git pull' uses to update the current branch.

?

See 'git help config' and search for 'push.default' for further information.

(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode

'current' instead of 'simple' if you sometimes use older versions of Git)

?

Username for 'https://github.com': wusang

Password for 'https://wusang@github.com':?

Counting objects: 24, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (21/21), done.

Writing objects: 100% (23/23), 8.51 KiB | 0 bytes/s, done.

Total 23 (delta 3), reused 0 (delta 0)

To https://github.com/wusang/lanou02.git

?? c054ac6..41b1085? master -> master

wuxiaoyuan:lanou02 lan$ git status

On branch master

Your branch is up-to-date with 'origin/master'.

?

Changes not staged for commit:

? (use "git add <file>..." to update what will be committed)

? (use "git checkout -- <file>..." to discard changes in working directory)

?

modified: ? lanou02/lanou02/ViewController.h

modified: ? lanou02/lanou02/ViewController.m

?

no changes added to commit (use "git add" and/or "git commit -a")

wuxiaoyuan:lanou02 lan$ git add .

wuxiaoyuan:lanou02 lan$ git commit -am "從暫存庫添加到本地倉庫,添加了1111"

[master f27a890] 從暫存庫添加到本地倉庫,添加了1111

?2 files changed, 4 insertions(+)

wuxiaoyuan:lanou02 lan$ git push

warning: push.default is unset; its implicit value is changing in

Git 2.0 from 'matching' to 'simple'. To squelch this message

and maintain the current behavior after the default changes, use:

?

? git config --global push.default matching

?

To squelch this message and adopt the new behavior now, use:

?

? git config --global push.default simple

?

When push.default is set to 'matching', git will push local branches

to the remote branches that already exist with the same name.

?

In Git 2.0, Git will default to the more conservative 'simple'

behavior, which only pushes the current branch to the corresponding

remote branch that 'git pull' uses to update the current branch.

?

See 'git help config' and search for 'push.default' for further information.

(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode

'current' instead of 'simple' if you sometimes use older versions of Git)

?

Counting objects: 11, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (6/6), done.

Writing objects: 100% (6/6), 607 bytes | 0 bytes/s, done.

Total 6 (delta 4), reused 0 (delta 0)

To https://github.com/wusang/lanou02.git

?? 41b1085..f27a890? master -> master

wuxiaoyuan:lanou02 lan$

?

與git相配合
簡單步驟:
》1.注冊一個github賬號
》2.配置SSH?Keys,?只要配置了SSH?Keys就可以和github無縫銜接
》點擊昵稱來到個人主頁
》?點擊主頁中的設置(setting)
》?點擊SSH?Keys
》點擊?generating?SSH?keys
》1.檢查本地的ssh?keys
在“用戶目錄”下?ls?-al?~/.ssh
2.如果文件夾不存在需要手動創建一個
mkdir?.ssh
3.根據github的提示2生成ssh?keys
在.ssh目錄下執行?ssh-keygen?-t?rsa?-C?"your_email@example.com”
輸入完成之后連續按下回車,?知道出現牛逼的圖形位置
4.生成完公鑰和私鑰之后輸入
ls?-la查看是否生成成功? ?id_rsa(私鑰)?id_rsa.pub(公鑰)
5.根據提示3獲得公鑰
pbcopy?<?~/.ssh/id_rsa.pub
6.點擊?setting?—》?ssh?key?—>add?ssh?key
將剛才獲取到得公鑰添加進去
7.更具github第4步提示,?驗證公鑰
驗證成功網頁上的灰色圓點會變成綠色
8.拷貝到公鑰之后打開github主頁
》點擊倉庫(Repositories)
》再點擊new來到github創建倉庫界面
9.通過github提供的地址下載一個空得倉庫到本地
》創建一個新的項目到本地倉庫文件夾中
》利用Xcode提交代碼到github
》注意:?要求輸入用戶名密碼時候,?輸入的是github上顯示的昵稱而不是登錄賬號
詳細步驟:
在桌面建立兩個空文件”張三””李四"(模擬多人開發)
1.進入https://github.com?(先要注冊githup個人賬號)?
2.
點擊進入
進入后界面有step1~step5 參照操作
終端命令行:
1.step1 用來確認狀態: ls -al ~/.ssh(輸出結果表明 ?張三文件夾沒有.ssh文件)
建立.ssh文件:
mkdir .ssh
cd 路徑
2.生成公鑰
step 2: ssh-keygen -t rsa -b 4096 -C "1149779588@qq.com"
3.Step 3: Add your key to the ssh-agent ?
Step 4: Add your SSH key to your account
Step 5: Test the connection
多人開發情況:
另一個人”李四”現在桌面的文件夾是空的
終端:
找到李四文件夾路徑:cd 拖過來的文件夾路徑
clone 倉庫網址:git clone URL網址
打開李四原來的空文件夾,發現已經克隆下來了工程
拉取其他人已經提交的代碼?
終端:
找到文件夾下的工程路徑: cd /Users/lan/Desktop/李四/lanou02
拉取工程: git pull
打開李四文件夾下的工程,發現已經同步到張三修改后的代碼

轉載于:https://www.cnblogs.com/wusang/p/4729440.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/273056.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/273056.shtml
英文地址,請注明出處:http://en.pswp.cn/news/273056.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

朱建輝php,朱建輝/laravel-bjyblog

鏈接簡介這個項目是把 thinkphp-bjyblog 用 laravel 框架重構后的產物&#xff1b;下圖中的白俊遙博客即是使用 laravel-bjyblog 開發的個人博客安裝使用可以通過以下兩種命令安裝&#xff1b;composer create-project baijunyao/laravel-bjyblog blog && cdblog &…

matlab 棍,雙足機器人行走棍圖怎么用MATLAB畫出來

匿名用戶1級2016-05-25 回答The following is a function I wrote to generate a stick diagram of robot motion. Hope it is helpful to you all.function stick(filename,user_frame_per_second,max_step)global robotfoot2;mov_traj load(filename);dt mov_traj(2,1) - …

設計模式學習筆記-觀察者模式

1. 概述 有時被稱作發布/訂閱模式&#xff0c;觀察者模式定義了一種一對多的依賴關系&#xff0c;讓多個觀察者對象同時監聽某一個主題對象。這個主題對象在狀態發生變化時&#xff0c;會通知所有觀察者對象&#xff0c;使它們能夠自動更新自己。 2. 解決的問題 將一個系統分割…

Handler與多線程

1、Handler介紹 在Android開發中&#xff0c;我們常會使用單獨的線程來完成某些操作&#xff0c;比如用一個線程來完成從網絡上下的圖片&#xff0c;然后顯示在一個ImageView上&#xff0c;在多線程操作時&#xff0c;Android中必須保證以下兩點&#xff1a; &#xff08;1&…

oracle read only 事務,oracle set transaction read only與dbms_transaction實現事務transaction控制...

SQL> show userUser is "SYS"SQL> set transaction read only;Transaction setSQL> insert into t_table values(3);1 row insertedSQL> commit;Commit complete---sys用戶 set transaction read only不生效SQL> select * from t_table;A------------…

oracle report builder 6i下載,oracle report builder 6i - 數據模型中的SQL查詢代碼

我是Vijetha&#xff0c;我正在研究報告6i&#xff0c;我很陌生 . 我有以下查詢 .在front_end中&#xff0c;在Reports Parameter中&#xff0c;當用戶單擊“運行”按鈕時&#xff0c;它將詢問START_DATE和END_DATE輸入 .如果用戶提供START_DATE和END_DATE或者不提供輸入&#…

HTML/CSS/JavaScript學習總結(轉)

HTML 網站開發的主要原則是&#xff1a; – 用標簽元素HTML描述網頁的內容結構&#xff1b; – 用CSS描述網頁的排版布局&#xff1b; – 用JavaScript描述網頁的事件處理&#xff0c;即鼠標或鍵盤在網頁元素上的動作后的程序 HTML&#xff08;Hyper Text Mark-up Language 超文…

oracle引用vs,VS2013中使用oracle,有關引用哪個.dll

Oracle、Microsoft 和第三方供應商都提供了針對 Oracle 產品進行了優化的數據供應程序。 Oracle 和 Microsoft 免費提供其 Oracle 數據供應程序。訪問 Oracle 的操作有些類似于對 Sql Server 的操作。對Oracle 的訪問有以下幾種數據提供程序。 Microsoft.NET Oracle 提供程序 O…

貪心方法

1.背包問題 按效益值/重量 進行排序輸入 2.帶限期的作用排序 按效益值進行排序輸入 3 最小生成樹&#xff1a; 貪心方法&#xff1a;每次計入成本最小的邊 原樹T&#xff0c; 欲構造的最小生成樹T Prim&#xff1a; 從T中選與T中結點相連的成本最小的邊。 且&#xff1a;邊之前…

oracle語法官方文檔,Oracle官方文檔必備語法知識

很多Oracle DBA雖然接觸Oracle時間很長&#xff0c;但是一旦想不起語法或找不出相應參數時&#xff0c;習慣百度或谷歌。雖然已經下載了官方文檔&#xff0c;但是Oracle官方文檔必備語法知識[日期&#xff1a;2015-04-21]來源&#xff1a;Linux社區作者&#xff1a;kuqlan[字體…

新中大oracle實列名,新中大財務軟件操作流程(完整版)

新中大財務軟件最基本的三個模塊&#xff1a;核算單位、財務處理系統、報表處理系統。簡單地說&#xff0c;核算單位模塊是用于建賬&#xff0c;財務處理系統用于登賬&#xff0c;報表處理系統用于出報表的。一、總賬處理系統1、建賬套雙擊財務軟件圖標 → 在登錄界面選擇用戶編…

編寫DLL所學所思(1)——導出函數

燭秋 http://www.cnblogs.com/cswuyg/archive/2011/09/30/dll.html 動態鏈接庫的使用有兩種方式&#xff0c;一種是顯式調用。一種是隱式調用。 &#xff08;1&#xff09; 顯式調用&#xff1a;使用LoadLibrary載入動態鏈接庫、使用GetProcAddress獲取某函數地址。 &am…

linux切換任務命令,Linux top詳解之交互命令、命令行選項

top交互命令我們之前說過top是一個交互命令。上一節我們已經遇到了一些命令。這里我們會探索更多的命令。2.1 ‘h’: 幫助首先&#xff0c;我們可以用’h’或者’?’顯示交互命令的幫助菜單。2.2 “或者”: 刷新顯示top命令默認在一個特定間隔(3秒)后刷新顯示。要手動刷新&am…

linux 內核地址隨機化,GNU/Linux內核的地址隨機化

地址空間布局隨機化(ASLR)是一項增加安全性的技術&#xff0c;***者發現漏洞之后開始編寫exploit時如果要考慮繞過ASLR這會增加編寫exploit的難度&#xff0c;最早是2001年Grsecurity社區(強悍的社區&#xff0c;直到今天還在為各種各樣的加固為自由軟件安全社區作出持續而杰出…

Yii2的一些問題

Yii2中刪除能不能串著用 Yii2中find、findAll有什么區別 Yii2中User::findOne($id)和User::find->where([id>1])->one; 會員登錄信息 是以什么樣的形式存放在Yii::$app->user->identity 里面的&#xff1f; session的形式 http://www.cnblogs.com/kuyuecs/archi…

linux系統硬盤設置密碼,LUKS:Linux下磁盤加密

Linux下磁盤加密LUKS(Linux Unified Key Setup)為Linux硬盤加密提供了一種標準&#xff0c;它不僅能通用于不同的Linux發行版本&#xff0c;還支持多用戶/口令。因為它的加密密鑰獨立于口令&#xff0c;所以如果口令失密&#xff0c;我們可以迅速改變口令而無需重新加密真個硬盤…

Hibernate查詢

9.1 Hibernate數據查詢 數據查詢與檢索是Hibernate的一個亮點。Hibernate的數據查詢方式主要有3種&#xff0c;它們是&#xff1a; l Hibernate Query Language&#xff08;HQL&#xff09; l Criteria Query l Native SQL 下面對這3種查詢方式分別進…

linux x86 io端口映射,linux中的 IO端口映射和IO內存映射

下面是今天看到兩篇關于linux中的 IO端口映射和IO內存映射的文章,時間關系,沒來得及深入理解,有空好好看看CPU地址空間CPU地址空間(一)地址的概念1)物理地址&#xff1a;CPU地址總線傳來的地址&#xff0c;由硬件電路控制其具體含義。物理地址中很大一部分是留給內存條中的內存…

單例模式 創建對象

兩種選擇 1 使用pthread_once&#xff0c; once是類的成員變量 只執行一次Create create的作用是創建一個對象 2 使用 static lock 如下所示&#xff0c;注意lock必須是static的&#xff0c;否則是局部變量&#xff0c;每個線程都有自己的lock&#xff0c;無法保證只執行一次。…

Linux c編譯庫路徑,【一點一點學Linux C】交叉編譯時候如何配置連接庫的搜索路徑...

交叉編譯的時候不能使用本地(i686機器&#xff0c;即PC機器&#xff0c;研發機器)機器上的庫&#xff0c;但是在做編譯鏈接的時候默認的是使用本地庫&#xff0c;即/usr/lib,/lib兩個目錄。因此&#xff0c;在交叉編譯的時候&#xff0c;要采取一些方法使得在編譯鏈接的時候找到…