ÔõÑùÔÚÍâµØ´î½¨github
Ëæ×Å¿ªÔ´ÉçÇøµÄÒ»Ö±Éú³¤£¬github ÒѾ³ÉΪÁËÒ»¸öºÜÊÇÖ÷ÒªµÄ´úÂëÍйÜƽ̨£¬Ëü²»µ«ÌṩÁË´úÂëÍйܵĹ¦Ð§£¬»¹ÌṩÁËÐí¶à¼òÆÓÒ×ÓõĹ¦Ð§£¬ÀýÈç code review¡¢issue ¸ú×Ù¡¢pull request µÈµÈ¡£ËäÈ»¿í´ó¿ª·¢Õß¿ÉÒÔʹÓà github ¾ÙÐдúÂëÍйܣ¬µ«ÓÐЩͬÑâ¿ÉÄÜ»áÓöµ½ÉÏÍøδ±ãµÈÎÊÌ⣬Òò´ËÐèÒªÍâµØ´î½¨ github£¬ÒÔ°ü¹Ü´úÂëµÄ˳³©¾ÙÐС£
Ò»¡¢×°ÖÃ Git
ÔÚÍâµØ´î½¨ GitHub Ç°£¬ÐèÒªÏÈ×°Öà Git¡£Git ÊÇÒ»¸öÂþÑÜʽ°æ±¾¿ØÖÆϵͳ£¬ÈκÎÒ»¸ö¿ª·¢ÍŶӶ¼ÎÞ·¨²»±Ø Git ¾ÙÐа汾¿ØÖÆ£¬Òò´Ë×°Öà Git ÊǴ GitHub µÄµÚÒ»²½¡£
ÔÚ Windows ÏÂ×°Öà Git ʱ£¬¿ÉÒÔ´Ó Git ¹Ù·½ÍøÕ¾ÏÂÔØ Git µÄ×°ÖóÌÐò£¬ÔÚ×°ÖÃʱһÆðƾ֤ĬÈÏÉèÖü´¿ÉÍê³É×°Öá£ÔÚ macOS »ò Linux ÏÂͨ¹ýÖÕ¶Ë×°Öà Git Ê®·Ö¼òÆÓ£¬Ö»ÐèÒªÔÚÖÕ¶ËÖÐÔËÐÐÈçÏÂÏÂÁî¼´¿É£º
sudo apt update sudo apt install git
µÇ¼ºó¸´ÖÆ
¶þ¡¢ÌìÉú SSH key
ΪÁËÈ·±£ÍâµØÓë GitHub Ö®¼äͨѶµÄÇå¾²ÐÔ£¬ÐèÒªÔÚÍâµØÌìÉú SSH key£¬ÒÔ±ãÔÚÓë GitHub ¾ÙÐÐͨѶʱ¾ÙÐÐУÑé¡£ÏÂÃ潫ÏÈÈÝÈç×÷Éõ GitHub ÌìÉú SSH key£º
ÔÚÏÂÁîÐÐÖÕ¶ËÖÐÊäÈë ssh-keygen -t ed25519 -C “your_email@example.com”¡£ÆäÖУ¬ÄãÐèÒª½« your_email@example.com Ì滻ΪÄãµÄÓÊÏäµØµã¡£
ƾ֤ÌáÐÑÒ»Æ𰴻سµ¼ü£¬Ö±µ½Ëæ»úÊýÌìÉúÍê³É¡£
ÌìÉúºó£¬ÔÚÍâµØÓû§¸ùĿ¼Ï嵀 .ssh Ŀ¼Ï¿ÉÒÔÕÒµ½ id_ed25519 ºÍ id_ed25519.pub Á½¸öÎļþ£¬ÆäÖÐ id_ed25519 ÊÇ˽ԿÎļþ£¬id_ed25519.pub Êǹ«Ô¿Îļþ¡£
Èý¡¢ÔÚ GitHub ÉÏÌí¼Ó¹«Ô¿
ÔÚÍâµØÌìÉú SSH key ºó£¬ÐèÒª½«¹«Ô¿¸´ÖƵ½ GitHub ÉÏ£¬²¢Ìí¼Óµ½ÄãµÄÕË»§ÖУ¬ÒÔ±ãÔÚ GitHub ÉϾÙÐдúÂë²Ù×÷¡£Ïêϸ°ì·¨ÈçÏ£º
·¿ª GitHub Ö÷Ò³ºó£¬µã»÷ÓÒÉϽǵÄÍ·Ïñ£¬½øÈë¡°Settings¡±½çÃæ¡£
ÔÚ¡°Settings¡±½çÃæÖУ¬Ñ¡Ôñ¡°SSH and GPG keys¡±Ñ¡ÏȻºóµã»÷¡°New SSH key¡±°´Å¥¡£
ÔÚ¡°Key¡±Îı¾¿òÖУ¬Õ³ÌùÖ®ËÞÊÀ³ÉµÄ id_ed25519.pub ÎļþÖеÄËùÓÐÄÚÈÝ¡£
¸ø¸Ã¹«Ô¿ÆðÒ»¸öÃû³Æ£¨Ëæ±ãÌ£¬È»ºóµã»÷¡°Add SSH key¡±°´Å¥¡£
ËÄ¡¢ÔÚÍâµØ´î½¨ GitHub
ÔÚÍê³ÉÁËÇ°Èý¸ö°ì·¨ºó£¬¼´¿É×îÏÈÔÚÍâµØ´î½¨ GitHub¡£
ÔÚÏÂÁîÐÐÖÕ¶ËÖÐÊäÈë git clone git@github.com:username/repo.git¡£ÆäÖУ¬username ΪÄãÔÚ GitHub ÉϵÄÕ˺ÅÃû£¬repo ΪÄãÒª clone µÄ¿ÍÕ»Ãû³Æ¡£
ÔÚÍâµØ£¬½øÈëµ½¸Õ¸Õ clone ÏÂÀ´µÄÏîĿĿ¼ÖУ¨Ò²¾ÍÊÇ repo Ŀ¼Ï£©¡£
ÔÚÍâµØ¾ÙÐдúÂëÐ޸ĺó£¬ÔÚÏÂÁîÐÐÖÐÊäÈëÈçÏÂÏÂÁ
git add . git commit -m "your message" git push
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬¡°your message¡±ÊÇÄã±¾´Î´úÂëÌá½»µÄÐÎòÐÅÏ¢¡£
OK£¬ÖÁ´Ë£¬ÍâµØ´î½¨ GitHub ¾Í´î½¨ÀÖ³ÉÁË£¬¸Ïæ×îÏÈÏíÊÜÎÞÍøÒ²ÎÞ¾åµÄ¿ªÔ´Ö®Âðɣ¡
ÒÔÉϾÍÊÇÔõÑùÔÚÍâµØ´î½¨githubµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡