<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國際加速解決方案。 廣告
                本文記錄通過git來自動部署php代碼的操作步驟。 試驗環境: * ubuntu server 14.04 # 一、創建服務器端倉庫   服務器上需要配置兩個倉庫,一個用于代碼中轉的**遠程倉庫**,一個用于http訪問的**本地倉庫**。   **這里的「遠程倉庫」并不等同于托管代碼的「中央倉庫」**,這兩個倉庫都是為了自動同步代碼并部署網站而存在。    * 在代碼部署目錄中建立git倉庫(假設為 /home/bl/www,用于http訪問) ~~~ cd ~ mkdir www cd www git init git config --global user.email "user@163.com" git config --global user.name "User" touch Readme.txt git add . git commit -a -m "first commit" ~~~ * 建立中轉的遠程倉庫(假設是 /home/bl/repos)執行 ~~~ mkdir -p ~/repos/project.git cd ~/repos/project.git git init --bare ~~~ * 向中轉的倉庫推送 ~~~ cd ~/www git remote add origin ~/repos/project.git git push origin master ~~~ * 修改.git目錄的權限 ~~~ cd ~/www chmod 700 -R .git ~~~ * * * * * # 二、服務器配置 Git Hook `cd ~/repos/project.git/hooks`   建立 post-receive 文件,內容如下: ~~~ #!/bin/sh unset GIT_DIR NowPath=`pwd` DeployPath="~/www/" cd $DeployPath git pull origin master cd $NowPath exit 0 ~~~ **`chmod a+x post-receive `** 設置可執行權限后,服務器端的配置就基本完成了。 * * * * * # 三、客戶端配置開發 ~~~ cd ~ git clone user@192.168.1.77:/home/bl/repos/project.git php_test cd php_test/ ~~~   修改a.txt文件 ~~~ git ci -a -m "test remote" git push origin master ~~~   現在查看遠端的~/www/目錄下的a.txt應該同步修改了(如果a.txt沒同步變化請檢查post-receive的執行權限)    # 四、設置免密碼登陸 * 生成 SSH 密鑰(如果本地已經生成可以跳過此步) `ssh-keygen -t rsa` * 將客戶端上的公鑰復制到SSH服務端 `ssh-copy-id user@ip_address`
                  <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>

                              哎呀哎呀视频在线观看