ÔõÑùʹÓÃGitÀ´¿ØÖÆÓû§ÕË»§ºÍȨÏÞ
gitÊÇÒ»ÖÖÇ¿Ê¢µÄ°æ±¾¿ØÖÆϵͳ£¬Ò²ÊÇÒ»¸öºÜÊÇÊܽӴýµÄ¿ªÔ´¹¤¾ß¡£³ýÁ˶ԴúÂë¾ÙÐа汾¿ØÖÆÖ®Í⣬git»¹¿ÉÒÔÓÃÓÚÖÎÀíÓû§ÕË»§ºÍȨÏÞ¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃgitÀ´¿ØÖÆÓû§ÕË»§ºÍȨÏÞ¡£
GitÊÇÔõÑùÊÂÇéµÄ£¿
ÔÚGitÖУ¬Ã¿¸öÓû§¶¼ÓÐÒ»¸öÕË»§£¬Ã¿¸öÕË»§¶¼ÓÐÒ»¸öΨһµÄ±êʶ·û¡£GitʹÓÃSSHÃÜÔ¿¶ÔÀ´ÑéÖ¤Óû§µÄÉí·Ý¡£ËùÓеÄÎļþºÍĿ¼¶¼´æ´¢ÔÚGit´æ´¢¿âÖС£µ±Óû§¶ÔÎļþºÍĿ¼¾ÙÐиü¸Äʱ£¬Git»á×Ô¶¯¸ú×ÙÕâЩ¸ü¸Ä£¬²¢ÇҼͼÏÂÕâЩ¸ü¸ÄµÄÀúÊ·¼Í¼¡£
ΪʲôҪʹÓÃGitÀ´¿ØÖÆÕ˺ÅȨÏÞ£¿
GitºÜÊÇÊÊÓÃÓÚÖÎÀí¶à¸öÓû§Ö®¼äµÄÐ×÷¡£È»¶ø£¬ÔÚÒ»¸ö¶àÓû§ÇéÐÎÖУ¬ÐèҪȷ±£Ã¿¸öÓû§Ö»ÄÜ»á¼ûËûÃÇÐèÒª»á¼ûµÄ×ÊÔ´¡£Òò´Ë£¬ÐèÒªÒ»ÖÖ¿É¿¿µÄÒªÁìÀ´¿ØÖÆÓû§µÄȨÏÞ¡£
ʹÓÃGit¾ÙÐÐÕË»§ÖÎÀí
GitʹÓÃÒ»¸öÃûΪgit-shellµÄÌØÊâShellÀ´ÖÎÀíÓû§ÕË»§ºÍȨÏÞ¡£Git-shellÊÇÒ»¸öÇáÁ¿¼¶µÄShell£¬ËüÖ»ÔÊÐíÓû§Ê¹ÓÃGitÏÂÁ²¢Õ¥È¡Ê¹ÓÃÆäËûÏÂÁî¡£
Ê×ÏÈ£¬ÄãÐèÒª½¨ÉèÒ»¸öÐÂÓû§ÕË»§¡£ÔÚLinuxϵͳÖУ¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´½¨ÉèÐÂÓû§£º
$ sudo adduser <username></username>
µÇ¼ºó¸´ÖÆ
½ÓÏÂÀ´£¬ÐèÒª½«¸ÃÓû§Ìí¼Óµ½Git´æ´¢¿âÖС£ÔÚGit´æ´¢¿âËùÔÚµÄЧÀÍÆ÷ÉÏ£¬Ê¹ÓÃÒÔÏÂÏÂÁ
$ sudo su git $ cd /path/to/repo.git $ vim ./gitolite/conf/gitolite.conf
µÇ¼ºó¸´ÖÆ
ÔÚgitolite.confÎļþÖУ¬Ìí¼ÓÐÂÓû§µÄSSHÃÜÔ¿£¬²¢Ö¸¶¨¸ÃÓû§µÄȨÏÞ¡£ÀýÈ磬¼ÙÉèÄãÐèҪΪÐÂÓû§½¨ÉèÒ»¸öÃûΪtest_projectµÄ¿ÍÕ»£¬²¢ÊÚÓèÖ»¶ÁȨÏÞ¡£¿ÉÒÔÔÚgitolite.confÎļþÖÐÌí¼ÓÒÔÏÂÄÚÈÝ£º
repo test_project RW+ = owner R = joeuser
µÇ¼ºó¸´ÖÆ
ÔÚÉÏÃæµÄʾÀýÖУ¬ownerÊÇ¿ÍÕ»µÄ½¨ÉèÕߣ¬Òò´Ë¾ßÓÐÍêÈ«µÄ¶ÁдȨÏÞ¡£joeuserÊÇÐÂÓû§µÄÓû§Ãû£¬Òò´ËÖ»ÓжÁȡȨÏÞ¡£
µ±ÄãÒѾ¸üÐÂÁËgitolite.confÎļþºó£¬Ê¹ÓÃÒÔÏÂÏÂÁî¸üÐÂGit´æ´¢¿âµÄÉèÖãº
$ sudo su git $ cd /path/to/repo.git $ ./gitolite/setup
µÇ¼ºó¸´ÖÆ
ÏÖÔÚ£¬ÐÂÓû§¾Í¿ÉÒÔʹÓÃSSHÃÜÔ¿¶ÔÉÏ°¶Ð§ÀÍÆ÷£¬²¢Ê¹ÓÃGit¾ÙÐлá¼ûºÍÖÎÀí¿ÍÕ»¡£
×ܽá
GitÊÇÒ»ÖÖºÜÊÇÇ¿Ê¢µÄ°æ±¾¿ØÖÆϵͳ£¬Ò²¿ÉÒÔÓÃÓÚÖÎÀí¶à¸öÓû§Ö®¼äµÄÐ×÷¡£Í¨¹ýʹÓÃGit-shellºÍgitolite.confÉèÖÃÎļþ£¬Äã¿ÉÒÔÇáËɵØΪ¶à¸öÓû§·ÖÅÉȨÏÞ£¬²¢È·±£Ã¿¸öÓû§Ö»ÄÜ»á¼ûËûÃÇÐèÒª»á¼ûµÄ×ÊÔ´¡£
ÒÔÉϾÍÊÇÔõÑùʹÓÃGitÀ´¿ØÖÆÓû§ÕË»§ºÍȨÏÞµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡