GIT 使用記錄,新手 會用(mac 使用者)

2023-01-22 21:35:59 字數 917 閱讀 9262

(唔,mac 使用者這個要求是因為整合在 terminal 中可直接使用)

1. github 中 建立 git 賬戶

2. github -> 在個人設定中 找到 ssh  and gpgkeys 頁面

3. terminal 中 ssh-keygen  生成一個ssh key(可選擇加入密碼)

4. github 中 new ssh key 建立個 title 然後加入剛生成的 key

5. 在電腦目錄中建立一個 專案 目錄 並 newfile.txt 檔案(隨便什麼檔案)

6. terminal 中 git init 

6.1 git add newfile.txt(隨便什麼檔案)

6.2 git commit -m 'newfile'  (最後的 newfile 是描述資訊)灰色代表可以不寫這兩個命令,直接新增賬戶

6.3 根據之前建立的賬戶, git -config --global user.email [email protected] ( 這裡是你的git郵箱)

6.4 git -config --global user.name yourname( 這裡是你的名字)

7. git remote add origin [email protected]:ming-os9/mbp.git ([email protected]:  後邊的是 github 你專案的地址)

8. git add . ( 新增所有此目錄的檔案)

9. git commit -m 'newfile'

10. git push -u origin master (第一次 push 這個設定比較麻煩 之後就簡單了)

11.1  git add .

11.2 git commit -m 'demostration for my commiting files'

11.3 git push

Mac使用記錄

恢復內容開始 brew list 檢視brew安裝東東 ls 當前目錄下內容 usr local cellar 隱藏檔案可以終端cd進去,也可以開啟finder後前往 users yangk desktop 進入桌面 command option 左右鍵 切換chrome標籤頁 open ssh 開...

github 新手使用記錄

個人用github 的筆記。網上各種各樣的github 教程都有,但可能很多人像我這樣,照著看,似懂非懂的操作成功了,以後要用到什麼功能又去查,反正,還是不懂。現在新建了一個專案 傳到 github,記錄下用的命令些。基本參考 這個寫的很簡潔,也很明瞭。其中有個地方,在 git add all 之前...