<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                `1.顯示服務器版本` ~~~ cat /etc/redhat-release CentOS release 6.4 (Final) ~~~ 服務器IP:172.17.17.37 客戶端IP:172.17.17.36 `2.安裝git` ~~~ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel ~~~ 下載`git-1.8.2.2.tar.gz` 到 `/usr/local/src` 下載網址[http://code.google.com/p/git-core](http://code.google.com/p/git-core),如果下載不了,可以到[github](https://github.com/git/git/releases/tag/v1.8.2.2)下載 ~~~ cd /usr/local/src tar -zvxf git-1.8.2.2.tar.gz cd git-1.8.2.2 make prefix=/usr/local/git all make prefix=/usr/local/git install ~~~ 增加軟連接 ~~~ ln -s /usr/local/git/bin/* /usr/bin/ git --version #如果能顯示版本號,即表示成功 ~~~ `3.安裝gitosis` ~~~ yum install python python-setuptools cd /usr/local/src git clone git://github.com/res0nat0r/gitosis.git cd gitosis python setup.py install ~~~ 顯示`Finished processing dependencies for gitosis==0.2`即表示成功 `4.在客戶端上,生成密鑰并上傳到服務器上` ~~~ ssh-keygen -t rsa #一路回車,不需要設置密碼 ~~~ 從開發機客戶端,上傳剛生成的公鑰到服務器(如果修改端口,按步驟4進行配置指定端口) ~~~ scp ~/.ssh/id_rsa.pub root@172.17.17.37:/tmp/ ls /tmp/id_rsa.pub ~~~ 顯示已經上傳的密鑰 `5.服務器上生成git用戶,使用git用戶并初始化gitosis` 增加git用戶 ~~~ adduser -m git ~~~ 切換用戶 ~~~ su - git ~~~ 服務器的公鑰(剛才客戶端上傳的),導入后客戶端即可以管理git服務器。 ~~~ gitosis-init < /tmp/id_rsa.pub ~~~ 顯示以下信息即表示成功 ~~~ Initialized empty Git repository in /home/git/repositories/gitosis-admin.git/ Reinitialized existing Git repository in /home/git/repositories/gitosis-admin.git/ ~~~ 修改權限 ~~~ [root@localhost git]# chmod 755 repositories/gitosis-admin.git/hooks/post-update ~~~ 刪除密鑰 ~~~ su - root rm -rf /tmp/id_rsa.pub ~~~ `6.在客戶端,復制git管理項目(git服務器管理,也是一個git倉庫)` ~~~ mkdir -p /repo cd /repo git clone git@172.17.17.37:gitosis-admin.git ~~~ `7.在客戶端,增加及設置管理項目` ~~~ cd /repo/gitosis-admin ~~~ 查看已經上傳密鑰 ~~~ ls keydir cat keydir/root\@localhost.localdomain.pub #root\@localhost.localdomain.pub為已經上傳的客戶端生成的公密 顯示密鑰最后的符串為密鑰用戶名,這里為root@localhost.localdomain ~~~ `vim gitosis.conf` ~~~ #在文件尾增加以下內容 [group test-git] # 組名稱 writable = test-git # 項目名稱 members = root@localhost.localdomain #密鑰用戶名 ~~~ ~~~ #提交修改 git add . git commit -a -m "add test-git repo" git push ~~~ `8.在客戶端,初始,增加及使用項目test-git` ~~~ cd /repo mkdir test-git cd test-git git init touch readme git add . git commit -a -m "init test-git" git remote add origin git@172.17.17.37:test-git.git git push origin master ~~~ `9.在服務器映射自己的項目html.git` ~~~ [root@localhost repositories]# pwd /home/git/repositories [root@localhost repositories]# ln -s /usr/local/apache/htdocs/ html.git [root@localhost repositories]# ls gitosis-admin.git html.git ~~~ 修改 gitosis.conf配置文件 ~~~ [root@localhost git]# pwd /home/git [root@localhost git]# ls -al 總用量 40 drwx------ 7 git git 4096 7月 15 05:31 . drwxr-xr-x. 4 root root 4096 7月 15 05:25 .. -rw-r--r-- 1 git git 18 7月 18 2013 .bash_logout -rw-r--r-- 1 git git 176 7月 18 2013 .bash_profile -rw-r--r-- 1 git git 124 7月 18 2013 .bashrc drwxr-xr-x 2 git git 4096 7月 15 05:27 gitosis lrwxrwxrwx 1 git git 53 7月 15 05:27 .gitosis.conf -> /home/git/repositories/gitosis-admin.git/gitosis.conf drwxr-xr-x 2 git git 4096 11月 12 2010 .gnome2 drwxr-xr-x 4 git git 4096 11月 30 2013 .mozilla drwxr-xr-x 3 git git 4096 7月 15 05:29 repositories drwx------ 2 git git 4096 7月 15 05:27 .ssh [root@localhost git]# vim .gitosis.conf #添加以下代碼: [group html] writable = html members = root@localhost.localdomain #進入html.git,初始化并賦權限 [root@localhost git]# cd repositories/html.git/ [root@localhost html.git]# git init [root@localhost html.git]# chmod -R 777 .git/ #修改配置 [root@localhost html.git]# git config receive.denyCurrentBranch ignore #更新庫,因為是直接git init ,所以要執行以下操作,才能在服務器上更新庫 [root@localhost html.git]# git reset --hard ~~~ ` 10.添加用戶` 1):在客戶端生成密鑰并上傳到服務器 ~~~ ssh-keygen -t rsa #一路回車 cd .ssh/ scp id_rsa.pub root@172.17.17.37:/tmp ~~~ 2):把上傳的公鑰復制到`/home/git/repositories/gitosis-admin.git/gitosis-export/keydir`(此步可以略過) ~~~ #查看公鑰的內容 [root@localhost keydir]# cat /tmp/id_rsa.pub #移動公鑰并重命名 [root@localhost keydir]# cp /tmp/id_rsa.pub /home/git/repositories/gitosis-admin.git/gitosis-export/keydir/Administrator@OADKY7QARNLQQUG.pub [root@localhost keydir]# ls Administrator@OADKY7QARNLQQUG.pub root@localhost.localdomain.pub ~~~ 3):把公鑰內容添加到authorized_keys ~~~ [root@localhost .ssh]# pwd /home/git/.ssh [root@localhost .ssh]# ls authorized_keys [root@localhost .ssh]# cat /tmp/id_rsa.pub >>authorized_keys ~~~ 4):客戶端訪問服務器(注意:要用絕對路徑) ~~~ git clone git@172.17.17.37:/home/git/repositories/html.git ~~~
                  <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>

                              哎呀哎呀视频在线观看