GitHub配置步驟和簡單的git關聯

2022-04-01 04:17:21 字數 1134 閱讀 3939

通過git書籍學習

1. 建立賬戶(username:flora)

2. 設定頭像(不是必須)

3. 設定ssh key

$ssh-keygen -t rsa -c "[email protected]" //建立使用者時使用的郵箱 -> 回車 -> 密碼 -> 密碼

生成id_rsa私有金鑰,id_rsa.pub公開金鑰

4. 新增公開金鑰

右上角 -> account settings -> ssh key -> add ssh key -> title適當,key是id_rsa.pub裡面的內容(用cat ~/.ssh/id_rsa.pub -> ssh-rsa 公開金鑰內容 [email protected]

->測試 ssh -t [email protected], 輸入yes

5. 使用

右上角 -> new repository建立乙個新庫(repository name: hello-world) -> 注意: "initialize this respository with a readme", 自動初始化庫並設定readme檔案,讓使用者可以立即clone這個倉庫。如果向github新增手中已有的git倉庫,不建議勾選,直接手動push -> 鏈結才倉庫(使用者名稱/hello-world庫名)-> readme.md檔案顯示專案等資訊,可以用markdown語法進行描述,新增標記,提高可讀性。

6. 將已有的倉庫clone到身邊的開發環境中。找到ssh clone url,將內容複製, git clone 複製的內容

ssh clone url: [email protected]:flora/hello-world.git 輸入建立key時的密碼

git clone [email protected]:flora/hello-world.git

cd hello-world

新增乙個檔案hello_world.php

git add hello_world.php 將檔案放到暫存區(在index資料結構中記錄問價提交之前的狀態)

git commit -m 'add hello_world file' 提交

git log 檢視提交日誌

git push 如果建立了分支(git branch develop)使用git push origin master

github的使用步驟

1,首先登陸到 平台上註冊乙個自己的賬號。2,然後在左上部分輸入乙個開源專案的 名字,我選擇的是 jvalidator 回車搜尋。3,在搜尋結果頁面找到如下如圖所示的專案,單擊專案名稱。4,此時,你已經進入到了rinh jvalidator的專案主頁了,單擊右上角的 fork 按鈕,就把這個專案co...

git上傳github和碼雲的步驟

建立版本庫 repository 1 開啟 gitbranch 2.建立乙個空檔案件 ckdir x 3,找到資料夾 cd 4.檢視當前檔案的位置 pwd5.把 目錄變成 git可以管理的倉庫 git init 6.如果 目錄沒有 git 說明隱藏起來了 可以用 ls ah 檢視 7.建立readm...

github上傳檔案的步驟

第一步 安裝 第二步 開啟github 輸入你的使用者名稱 郵箱和密碼,你會進行到這個頁面 點選紅框框出現接下的介面 第三步 你會進入到這個頁面 點選setting 選中之後頁面會閃一下 第四步 當你完成了第一步的安裝之後,在桌面,滑鼠右擊,點選 git bash here,接下來你就進入那無處安放...