git學習小結

來源:互聯網
上載者:User

標籤:git apache 版本控制

背景:最近因為工作原因,需要將以前的程式碼程式庫由bitbucket重新布置在一台伺服器上,所以就學習了下git,特此記錄下


650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/44/56/wKioL1PgvvLxPz9_AAEZ44inoPY902.jpg" title="git.png" alt="wKioL1PgvvLxPz9_AAEZ44inoPY902.jpg" />



  1. 在167這台機器上搭建apache,用做git server,由於以前apache都已經搭好了,所以這裡只配置git server 就可以了,此處貼出配置:
    650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/44/56/wKioL1PgwUOgHT2ZAAE5oFctV90085.jpg" title="git_server.jpg" alt="wKioL1PgwUOgHT2ZAAE5oFctV90085.jpg" />

  2. 伺服器搭好了,來到配置中的root目錄,git clone https://[email protected]/XXXX

  3. 此時,庫和伺服器都搭好了,用於新庫測試的機器也可以從git server上複製庫了,來,我們來試試從新庫測試機上push看看,出現了一些錯誤:
     error: unpack failed: unpack-objects abnormal exit

  4. 檢查git server 配置沒有問題,查看庫的配置

    需要將server的.git/config改為以下代碼:

    650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/44/56/wKioL1PgxAPyrm82AAAuSJLwlh0514.jpg" title="git_config.jpg" alt="wKioL1PgxAPyrm82AAAuSJLwlh0514.jpg" />
    此時從新庫測試機上push就不會出錯啦~~


  5. 然後再在57和103上運行以下命令,然後就ok啦~~~

    祝:新加使用者用命令:htpasswd -m /data/git/user.pwd username

  6. git remote set-url origin http://[email protected]:81/XXX
  7. 最後附上git的電子書連結:
    http://lvwzhen.github.io/Git-Tutorial/



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.