部署gitosis與windows管理

來源:互聯網
上載者:User

標籤:

在版本控制工具中,git有更好的表現。

  網上的Gitosis部署都是在同系統完成(Linux)。

  本篇所講,是不同於此種方式。

  --------------------------------------------------------------

  備份機:Gitosis伺服器(Ubuntu 12.4)

  管理機:Gitosis客戶機(Win XP)

  --------------------------------------------------------------

  首先,安裝Gitosis伺服器

  1. 安裝ssh

 

[plain] view plaincopy 
  1. sudo apt-get install ssh  

  2. 安裝git

 

 

[plain] view plaincopy 
  1. sudo apt-get install git-core  

  3.安裝gitosis

 

    (1) 安裝python-setuptools

[plain] view plaincopy 
  1. sudo apt-get install python-setuptools  

   (2)安裝gitosis

[plain] view plaincopy 
  1. mkdir ~/gitosis_setup  
  2. cd ~/ gitosis_setup  
  3. git clone https://github.com/res0nat0r/gitosis.git  
  4. cd gitosis  
  5. sudo python setup.py install  

  4.增加git使用者

[plain] view plaincopy 
  1.  sudo adduser \    
  2. --system \    
  3. --shell /bin/sh \    
  4. --gecos ‘git version control‘ \    
  5. --group \    
  6. --disabled-password \    
  7. --home /home/git \    
  8. git   


    至此,Gitosis安裝完畢。

 

-----------------------------------------------------------------------------------------------------------美麗的分割線-----------------------------------------------

  然後,在windows設定備份機。

 

   -------------------------------------------------------------------

  支撐工具:msysgit、TortoiseGit

  (注)安裝TortoiseGit需要Windows Installer 4.5

  -------------------------------------------------------------------

  1. 請求授權

      (注)此操作在git bash中進行。

     (1)產生本機RSA公開金鑰

 

[plain] view plaincopy 
  1. ssh-keygen -t rsa  

     (2)上傳本機RSA公開金鑰

[plain] view plaincopy 
  1. scp id_rsa.pub [email protected]:/home/tdtc010  

      /*

 

         tdtc010:備份機系統使用者

         ip(192.168.1.100):備份機ip地址

         目錄(/home/tdtc010):備份機目錄

      */
  2. 授予許可權

     (注)此操作在PuTTY中進行。

    (1)初始化Git版本庫

 

[plain] view plaincopy 
  1. sudo -H -u git gitosis-init < /home/tdtc010/id_rsa.pub  

   (2)授權檔案許可權

[plain] view plaincopy 
  1. sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update  


  3.clone管理庫

 

    (注)此操作在git bash中進行。

 

[plain] view plaincopy 
  1. mkdir test1_proj  
[plain] view plaincopy 
  1. cd test1_proj  
[plain] view plaincopy 
  1. git clone [email protected]:gitosis-admin.git  

 

 

全文完。


參考文章:http://blog.csdn.net/csfreebird/article/details/7204345

 

附件:

       I.REMOTE HOST IDENTIFICATION HAS CHANGED!

         我們使用scp的時候,有可能會出現上述警告。

         這是由於本機(管理機)IP地址發生變化。

         更改known_hosts檔案中的“192.168.1.100”為現在的IP地址

[plain] view plaincopy 
  1. 192.168.1.100 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDpEuYSTWi+w/RoM4TJtq4Xu7IMSuiDZjUCFBect2juLNFf0zr2vcd8vCRikMbWd0TOS5FS5eX+6c8ygbdfRa8Q8zHTMVAfyX2QRKQb1wtWKFPqmfZiONuCIv2pSylXBo1GwmU0OolTtZVLfDXQpIW4mUqx9QCzABSqCfHZyM/a0nTJgN+AeLTV4OUvAX17zeZnZCIA9SGn34BlmwBlKAVm4ZLV2CZ7o1SvYrjplCsb+D4BOS1nm9lWVmw4gqsojQ7Uko8Cx4T5TnKDj/VvHnSY+zPphQkicNwMcENUFTUgDTGFrFH8puidjh0YNASjrEabRse2yHq9Qwc4tb2DHrc1  

        參考文章:http://qdjalone.blog.51cto.com/1222376/616641

 

      II. Pictures

 

部署gitosis與windows管理

聯繫我們

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