git 項目初始化

來源:互聯網
上載者:User

標籤:style   class   blog   code   color   com   

1.在git伺服器介面右上方“+” 、create  new  project ,寫上項目名字產生一個新的組

2.如果機器第一次與git 建立串連,需要讓機器產生一個id_rsa和id_rsa.pub 檔案,然後無空格的開啟.pub這個檔案,複製到git伺服器介面的my project ->SSH Key ->add New ->起個名字,將粘貼內容放大內容 部分,無問題的話就ok了。產生id_rsa如下:

ssh-keygen -t rsa -C “[email protected]”

按3個斷行符號,如果密碼為空白

最後得到了兩個檔案:id_rsa和id_rsa.pub

在git伺服器介面上添加ssh密鑰,這要添加的是“id_rsa.pub”裡面的公開金鑰。

 (第二部的內容未經成功驗證)

也可以將已經於git伺服器建立過串連的機器上的id_rsa 複製到這台機器上的 ~/.ssh/下。不用對git伺服器介面添加公開金鑰(私用不適合大家)

3.接下來git伺服器介面會提示你接下來怎麼做,如下:

git config --global user.name "Firstname Lastname"git config --global user.email "[email protected]"git  init git  add .  //在要提交的項目根目錄下git  commit  -m  "first commit "git  remote  add  origin   [email protected]:xxx/xxx.gitgit  push  -u  origin   master  

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.