<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # GitHub托管服務 [TOC] Github顧名思義是一個Git版本庫的托管服務,是目前全球最大的軟件倉庫,擁有上百萬的開發者用戶,也是軟件開發和尋找資源的最佳途徑,Github不僅可以托管各種Git版本倉庫,還擁有了更美觀的Web界面,您的代碼文件可以被任何人克隆,使得開發者為開源項貢獻代碼變得更加容易,當然也可以付費購買私有庫 網址: https://github.com/ ## 1. 注冊賬號 略 ## 2. ssh連接 在向Github推送文件時,可以選擇SSH協議模式,在本機生成密鑰 ### 1) 生成秘鑰對 ```sh ssh-keygen ``` ### 2) 查看公鑰 ```sh cat ./.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjstpzmbFy4x1cGx/GP5D5ubtVDdG0vn1Pibs4sVMyYJmJKYogY4y19Srczyc.......jz8pkH+5jZZ5zNfkQ+k38hQFt88oZ8ka2GJQ+pSzgQAtFC0CHtpsuaVolFvER5TfEPW1P3 root@m01 ``` 復制以上公鑰,用于添加到GitHub中 ### 3) GitHub增加公鑰 點擊setting賬戶配置 ![mark](http://noah-pic.oss-cn-chengdu.aliyuncs.com/pic/20200308/180921013.png) 點擊SSH keys ![mark](http://noah-pic.oss-cn-chengdu.aliyuncs.com/pic/20200308/180930413.png) 添加git服務器上生成的公鑰id_rsa.pub點擊Add key添加 ![mark](http://noah-pic.oss-cn-chengdu.aliyuncs.com/pic/20200308/180937930.png) 查看ssh公鑰信息 ![mark](http://noah-pic.oss-cn-chengdu.aliyuncs.com/pic/20200308/180947331.png) ## 3. 建倉庫 ### 1) 點擊創建一個新的倉庫 ![mark](http://noah-pic.oss-cn-chengdu.aliyuncs.com/pic/20200308/180955866.png) ### 2) 輸入具體信息 ![mark](http://noah-pic.oss-cn-chengdu.aliyuncs.com/pic/20200308/181003532.png) ### 3) 填寫倉庫的信息 ![mark](http://noah-pic.oss-cn-chengdu.aliyuncs.com/pic/20200308/181014569.png) ### 4) 克隆遠程倉庫到本地 創建成功后會跳轉到該倉庫,選擇ssh模式,復制版本倉庫克隆地址,然后在linux命令行用clone命令進行克隆 ```sh git clone git@github.com:xubusi3/demo.git Cloninginto 'demo'... remote: Counting objects: 3, done. remote:Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Receiving objects: 100% (3/3), done. ``` 查看克隆下來的文件內容 ```sh cat demo/README.md # demo 描述信息--可以不寫 ``` ## 4. 提交數據到遠程倉庫 ### 1) 創建新文件并提交到本地倉庫 ```sh [root@xxx ~]# cd demo/ [root@xxx ~]# echo "test is git" >>test.txt [root@xxx ~]# git add test.txt [root@xxx ~]# git commit -m "add test file" [master 66cace0] add test file 1 file changed, 1 insertion(+) create mode 100644 test.txt ``` ### 2) 同步到遠程倉庫 查看本機遠程倉庫列表 ``` [root@xxx ~]# git remote origin ``` 同步到遠程倉庫origin ``` [root@xxx ~]# git push -u origin master 將本地的Git倉庫同步到遠程Github服務器上(第一次請加上參數-u,代表關聯本地與遠程) Counting objects: 4, done. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 281 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To git@github.com:xubusi3/demo.git 1b836ba..66cace0 master -> master Branch master set up to track remote branch master from origin. ``` ### 3) 結果驗證 刷新一下web,果然看到版本倉庫已經同步了 ![mark](http://noah-pic.oss-cn-chengdu.aliyuncs.com/pic/20200308/181025379.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看