LinuxÉÏÔõô´î½¨githubЧÀÍÆ÷
githubÊÇÈ«Çò×î´óµÄ³ÌÐòÔ±Éç½»ÍøÕ¾£¬¿ª·¢Õß¿ÉÒÔÔÚÉÏÃæÅäºÏÐ×÷¿ªÕ¹ÏîÄ¿¡£ÎªÁ˸üºÃµØÐ×÷ºÍÖÎÀí´úÂ룬Ðí¶à³ÌÐòԱѡÔñÔÚ×Ô¼ºµÄЧÀÍÆ÷ÉϴgithubЧÀÍÆ÷¡£ÏÂÃæÎÒÃǽ«ÏÈÈÝÔõÑùÔÚlinuxЧÀÍÆ÷ÉϴgithubЧÀÍÆ÷¡£
µÚÒ»²½£º×°ÖÃGit
ÔÚLinuxЧÀÍÆ÷ÉϴGitHubЧÀÍÆ÷£¬Ê×ÏÈҪװÖÃGit¡£Ê¹ÓÃÒÔÏÂÏÂÁî×°ÖÃGit£º
sudo apt-get install git-core
µÇ¼ºó¸´ÖÆ
×°Öúó£¬Äú¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÑéÖ¤GitÊÇ·ñÀÖ³É×°Öãº
git --version
µÇ¼ºó¸´ÖÆ
µÚ¶þ²½£º½¨ÉèÓû§
ΪÁ˸üºÃµØÖÎÀí´úÂ룬Äú¿ÉÒÔΪÿ¸öÐ×÷Õß½¨ÉèÒ»¸öµ¥¶ÀµÄÓû§¡£Ê¹ÓÃÒÔÏÂÏÂÁÉèÓû§£º
sudo adduser <username></username>
µÇ¼ºó¸´ÖÆ
ÆäÖÐusernameÊÇÄúÒª½¨ÉèµÄÓû§Ãû¡£È»ºóÉèÖÃÓû§ÃÜÂ룬׷ËæÏÂÁîÌáÐÑÍê³ÉÉèÖü´¿É¡£
µÚÈý²½£º½¨ÉèSSHÃÜÔ¿
ΪÁËÈ·±£Çå¾²ÐÔ²¢ÔÊÐíÐ×÷ÕßÍÆË͸ü¸Ä£¬ÎÒÃÇÐèÒªÔÚÿ¸öÓû§ÉÏÉèÖÃSSHÃÜÔ¿¡£Ê×ÏÈ£¬ÎÒÃÇÐèÒªÔÚÿ¸öÓû§ÉϽ¨ÉèÒ»¸öSSHÃÜÔ¿¡£
±¬·¢ÃÜԿʹÓÃÒÔÏÂÏÂÁ
ssh-keygen -t rsa -C "<email>"</email>
µÇ¼ºó¸´ÖÆ
email ÌîдÄúµÄÓÊÏäµØµã¡£
½«ÃÜÔ¿Ìí¼ÓÖÁ¹«¹²»á¼û£º
cd /home/<username>/.ssh cp id_rsa.pub authorized_keys chmod 700 ~/.ssh chmod 600 ~/.ssh/* sudo chown -R <username>:<username> ~/.ssh</username></username></username>
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬home/ ÊÇÓû§µÄÎļþ¼ÐλÖá£
µÚËIJ½£º½¨Éè¿ÍÕ»
ÔÚÄúµÄÓû§Ä¿Â¼Ï½¨ÉèÒ»¸öÐÂĿ¼£¬ÎªÄúµÄÐÂÏîÄ¿½¨ÉèÒ»¸öеĴ洢¿â£º
mkdir /home/<username>/<project_name>.git cd /home/<username>/<project_name>.git git init --bare</project_name></username></project_name></username>
µÇ¼ºó¸´ÖÆ
È»ºó¸ü¸Ä´æ´¢¿âµÄȨÏÞ£¬ÒÔ±ãÆäËûÓû§Ò²¿ÉÒÔ»á¼ûËü£º
sudo chown -R <username>:<username> /home/<username>/<project_name>.git sudo chmod -R ug+rwX /home/<username>/<project_name>.git</project_name></username></project_name></username></username></username>
µÇ¼ºó¸´ÖÆ
´ËʱÄúÒѾÀÖ³ÉÔÚЧÀÍÆ÷ÉϴÁËÒ»¸öGitHubЧÀÍÆ÷£¬Äú¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÔÚÄúµÄÅÌËã»úÉϾÙÐпË¡£¬Ìí¼Ó¸ü¸Ä²¢½«ËüÃÇÍÆËÍ»ØЧÀÍÆ÷£º
git clone <username>@<serverip>:/<username>/<project_name>.git></project_name></username></serverip></username>
µÇ¼ºó¸´ÖÆ
ÐÞ¸ÄÍê´úÂëºó¿ÉÒÔ½«´úÂëÍÆËÍÖÁgitЧÀÍÆ÷:
git add . git commit -m "first commit code " git push origin master
µÇ¼ºó¸´ÖÆ
ÒÔÉÏÊÇÔÚLinuxЧÀÍÆ÷ÉϴGitHubЧÀÍÆ÷µÄһЩ¼òÆÓÏÈÈÝ¡£Ï£ÍûÄܶÔÄúÓÐËù×ÊÖú¡£Äú¿ÉÒÔƾ֤×Ô¼ºµÄÐèÇó¾ÙÐе÷½âºÍˢС£
ÒÔÉϾÍÊÇLinuxÉÏÔõô´î½¨githubЧÀÍÆ÷µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡