git經常使用命令

怎麼獲取SSH Key?git

第一次獲取遠程的git代碼時,本地沒有ssh key,使用如下命令能夠生成(注意:yufeng.x是用戶名):
ssh-keygen -t rsa -C "yufeng.x"ssh

一直按回車,最後獲得兩個文件:id_rsa和id_rsa.pub
Your identification has been saved in /Users/xieyufeng/.ssh/id_rsa.
Your public key has been saved in /Users/xieyufeng/.ssh/id_rsa.pub.
經過cat命令顯示ssh key:
cat /Users/xieyufeng/.ssh/id_rsa.pubide

 

clone 倉庫gitlab

git clone git@gitlab.com:yufeng.x/mywork.git命令行

查看遠程倉庫地址code

git remote -vcdn

上傳代碼blog

上傳代碼很簡單,主要是3個命令行:
(1) git add -A
(2) git commit -m 「版本描述」
這兩個命令行只是本地庫,創建索引,代碼並無傳到遠程庫。
screenshot
(3) git push --all
經過push 把HEAD中的索引指向的代碼提交到遠程倉庫。索引

相關文章
相關標籤/搜索