<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 ## 創建倉庫 1. 注冊GitHub帳號,通過郵箱驗證 2. 在GitHub創建倉庫 1. 點擊右方的“new repository”按鈕創建一個倉庫 ![image](http://upload-images.jianshu.io/upload_images/13962870-44037ce434caf1a2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 2. Repository name框取一個名字 3. 點擊Create repository完成創建 ## 安裝git 1. [https://git-scm.com/downloads](https://git-scm.com/downloads)下載并安裝git - ubuntu可以使用命令 `sudo apt-get install git` ## 設置ssh key ### 1. 創建用戶名和密碼 ``` git config --global user.name "hello" git config --global user.email "hello@163.com" ``` ### 2. 生成ssh密鑰 輸入命令: ``` ssh-keygen -t rsa -C "hello@163.com" ``` - 此處郵箱為github的郵箱 連續按三個回車: ``` Generating public/private rsa key pair. Enter file in which to save the key (/home/xuanli/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/xuanli/.ssh/id_rsa. Your public key has been saved in /home/xuanli/.ssh/id_rsa.pub. The key fingerprint is: SHA256:Fn9I3+UV3NxeMQT4G75KyMjNteTrfxuU+8PSjF1Bkr0 hello@163.com.com The key's randomart image is: +---[RSA 2048]----+ | ..**+| | . o +B| | . . . o.=| | + o + E+| | S oo+ +oo| | ..= =..o. o| | o = + Bo.| | . .+ Bo| | .+o.o.+| +----[SHA256]-----+ ``` 出現類似這樣的提示代表密鑰創建完成。 ``` Your public key has been saved in /home/xuanli/.ssh/id_rsa.pub. ``` 指定了密鑰存放位置 ### 3. 添加到github - 打開github,點擊頭像,選擇settings ![image](http://upload-images.jianshu.io/upload_images/13962870-08cbc36a3f59a2c9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) - 選擇SSH and GPG keys ![image](http://upload-images.jianshu.io/upload_images/13962870-96a3bc9ce2a9e4f4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) - 點擊new SSH key - title隨便填寫,復制id_rsa.pub中的內容,到key中 ![image](http://upload-images.jianshu.io/upload_images/13962870-4a0acdaba1116fde.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) - 點擊 Add SSH key ### 4.檢測是否成功 輸入命令 ``` ssh -T git@github.com ``` 輸入yes,如果HI之后的名字是你github的用戶名的話說明成功 ## 上傳代碼到github 進入項目根目錄 ### 1.初始化本地倉庫 輸入命令 ``` git init ``` 這個命令會在當前目錄創建一個 .git 的文件 ### 2.添加文件到暫存區 ``` git add . ``` `.`代表所有,也可以指定文件名 ### 3.將暫存區文件提交到倉庫區 ``` git commit -m '版本描述' ``` - -m 后邊跟得是版本描述 ### 4.創建關聯地址 ``` git remote add origin git@github.com:XXX/XXX.git ``` - origin 后為github倉庫的地址,要選擇ssh地址而不是https地址 ![image](http://upload-images.jianshu.io/upload_images/13962870-2a71d72d4e3d631f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### 5.上傳到github ``` git push -u origin master ``` 上面命令將本地的master分支推送到origin主機,同時指定origin為默認主機。 到現在為止,便上傳完成。
                  <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>

                              哎呀哎呀视频在线观看