使用百度網盤配置私人Git服務

來源:互聯網
上載者:User

GitHub上免費的版本只能開原始碼庫,有時候需要配置些私人的服務,不方便公開。現在免費的網盤的容量越來越大,可以用來做儲存的服務,如果只使用網盤儲存合并代碼很不方便,所以使用網盤+git 配置私人倉庫。

1.首先當然是註冊網盤,然後在PC上建立共用資料夾,用於網盤的自動同步。

2.在共用檔案中初始化Git服務做遠程倉庫

cd /Users/apple/百度雲同步網盤/BaiduRepo 
git --bare init

3.工程中添加git

git init            git add .           目錄下所有檔案添加到索引git commit -m      

4.提交本地工程到網盤

git remote add BaiduRepo /Users/apple/百度雲同步網盤/BaiduRepo//將本地倉庫master分支push到遠程倉庫git push BaiduRepo master 

 5.提交成功後,可以正常使用git操作

$ git clone /Users/apple/百度雲同步盤/BaiduRepo  $ git staus $ git add . $ git push $ git pull 

 

如果commit時出現如下提交錯誤

$ git commit - either -m or --a

 解決方案

$ git config --global core.editor vim

 

參考資料:

http://www.cnblogs.com/zdz8207/archive/2012/05/20/2509356.html

聯繫我們

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