×ðÁú¿­Ê±

SSHÔõÑùÉèÖÃGit

ÔÚʹÓÃgit¾ÙÐа汾¿ØÖƵÄÀú³ÌÖÐ £¬sshÓÃÓÚÇå¾²µØÅþÁ¬µ½Ð§ÀÍÆ÷ºÍ´æ´¢¿â¡£ÈôÊÇÄãÏëҪʹÓÃsshÀ´ÅþÁ¬µ½´æ´¢¿âºÍ¾ÙÐÐpushºÍpull²Ù×÷ £¬ÄãÐèÒªÏȾÙÐÐssh ÉèÖá£

ÏÂÃæÊÇSSHÉèÖÃGitµÄ°ì·¨£º

1.ÌìÉúSSHÃÜÔ¿

ҪʹÓÃSSHÅþÁ¬µ½Git´æ´¢¿â £¬ÄãÐèÒªÌìÉúSSHÃÜÔ¿²¢½«ÆäÌí¼Óµ½ÄãµÄGitÕÊ»§ÖС£

ÒªÌìÉúSSHÃÜÔ¿ £¬Çë·­¿ªÖն˲¢ÊäÈëÒÔÏÂÏÂÁ

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

µÇ¼ºó¸´ÖÆ

Õâ¸öÏÂÁÌìÉúÒ»¸öSSHÃÜÔ¿¶Ô £¬°üÀ¨Ò»¸ö¹«Ô¿£¨id_rsa.pub£©ºÍÒ»¸ö˽Կ£¨id_rsa£©¡£Çë×¢ÖØ £¬ÉÏÃæµÄÏÂÁî·ºÆðµÄyour_email@example.comÓ¦¸ÃÌ滻ΪÄã×Ô¼ºµÄµç×ÓÓʼþµØµã¡£

°´»Ø³µ¼üºó £¬Ä㽫±»ÒªÇóÊäÈëÎļþÃûºÍÃÜÂë¡£ÈôÊÇÄã²»ÏëΪÄãµÄÃÜÔ¿ÉèÖÃÃÜÂë £¬Äã¿ÉÒÔÖ±½Ó°´»Ø³µ¼üÌø¹ý¡£

2.Ìí¼Ó¹«Ô¿µ½ÄãµÄGitÕË»§

ÔÚÄãʹÓÃSSHÅþÁ¬µ½Git´æ´¢¿â֮ǰ £¬ÄãÐèÒª½«¹«Ô¿Ìí¼Óµ½ÄãµÄGitÕË»§ÖС£ÕâÑù £¬Git¾Í»áÈÏ¿ÉÄãµÄSSHÃÜÔ¿ £¬²¢ÊÚȨÄã¾ÙÐÐpushºÍpull²Ù×÷¡£

Òª½«¹«Ô¿Ìí¼Óµ½ÄãµÄGitÕË»§ £¬ÇëÏȸ´Öƹ«Ô¿¡£·­¿ªÖն˲¢ÊäÈëÒÔÏÂÏÂÁ

cat ~/.ssh/id_rsa.pub

µÇ¼ºó¸´ÖÆ

¸ÃÏÂÁÏÔʾÄãµÄ¹«Ô¿¡£Ç뽫ËùÓÐÄÚÈݸ´ÖƵ½ÄãµÄGitÕË»§ÖС£·­¿ªÄãµÄGitÕË»§ £¬²¢ÔÚÒ³ÃæµÄÓÒÉϽÇÑ¡Ôñ¡°Settings¡±>¡°SSH and GPG keys¡±>¡°New SSH key¡±¡£

ÔÚ¡°Title¡±×Ö¶ÎÖÐÊäÈëÒ»¸öÐÎòÐÔµÄÃû³Æ£¨ÀýÈç¡°×Ô¼ºµÄÃÜÔ¿¡±£© £¬È»ºó½«ÄãµÄ¹«Ô¿¸´ÖƵ½¡°Key¡±×Ö¶ÎÖС£µ¥»÷¡°Add SSH key¡±°´Å¥ £¬ÄãµÄ¹«Ô¿¾Í±»Ìí¼Óµ½ÄãµÄGitÕË»§ÖÐÁË¡£

3.ʹÓÃSSHÅþÁ¬µ½Git´æ´¢¿â

ÏÖÔÚÄãÒѾ­ÌìÉúÁËSSHÃÜÔ¿²¢½«¹«Ô¿Ìí¼Óµ½ÁËÄãµÄGitÕË»§ÖÐ £¬Äã¿ÉÒÔʹÓÃSSHÅþÁ¬µ½Git´æ´¢¿â²¢¾ÙÐÐpushºÍpull²Ù×÷¡£

ҪʹÓÃSSHÅþÁ¬µ½Git´æ´¢¿â £¬ÇëÊ×ÏÈ»ñÈ¡´æ´¢¿âµÄSSH URL¡£ÔÚÄãµÄGit´æ´¢¿âÒ³ÃæÖÐ £¬µ¥»÷¡°Clone or download¡±°´Å¥ £¬²¢È·±£¡°Clone with SSH¡±Ñ¡ÏîÊÇÑ¡ÖеÄ¡£Ä㽫¿´µ½¸Ã´æ´¢¿âµÄSSH URL £¬¿ÉÒÔ½«Æ临ÖƵ½¼ôÌù°åÖС£

·­¿ªÖÕ¶Ë £¬½øÈëÄã´æ´¢´úÂëµÄĿ¼²¢ÊäÈëÒÔÏÂÏÂÁ

git remote set-url origin git@github.com:yourusername/yourrepository.git

µÇ¼ºó¸´ÖÆ

ÉÏÃæµÄÏÂÁî»á½«Äã´æ´¢´úÂëµÄ´æ´¢¿âÓëSSH URLÏà¹ØÁª £¬ÕâÑùÄã¾Í¿ÉÒÔʹÓÃSSHÅþÁ¬µ½¸Ã´æ´¢¿â¡£

ÏÖÔÚ £¬Äã¿ÉÒÔʹÓÃSSHÅþÁ¬µ½¸Ã´æ´¢¿â £¬²¢¾ÙÐÐpushºÍpull²Ù×÷¡£ÀýÈç £¬Òª½«ÄãµÄ´úÂëÍÆË͵½Git´æ´¢¿â £¬ÇëʹÓÃÒÔÏÂÏÂÁ

git push -u origin master

µÇ¼ºó¸´ÖÆ

ÉÏÃæµÄÏÂÁî»á½«ÄãµÄ´úÂëÍÆË͵½Git´æ´¢¿â £¬²¢½«ÆäÓë¡°master¡±·ÖÖ§Ïà¹ØÁª¡£µÚÒ»´ÎÍÆËÍʱ £¬ÇëʹÓÃ-uÑ¡Ïî £¬ÒÔ±ãÔÚδÀ´µÄÍÆËͲÙ×÷Öн«ÄãÍâµØµÄmaster·ÖÖ§ÓëÔ¶³ÌµÄmaster·ÖÖ§Ïà¹ØÁª¡£

½áÂÛ

ÔÚʹÓÃGitʱ £¬SSHÊÇÒ»¸öºÜÊÇÓÐÓõŤ¾ß £¬¿É×ÊÖúÄãÇå¾²µØÅþÁ¬µ½Ð§ÀÍÆ÷ºÍ´æ´¢¿â¡£Í¨¹ýƾ֤ÉÏÃæµÄ°ì·¨¾ÙÐÐÉèÖà £¬Äã¿ÉÒÔÇáËɵØʹÓÃSSHÅþÁ¬µ½Git´æ´¢¿â £¬²¢¾ÙÐÐpushºÍpull²Ù×÷¡£

ÒÔÉϾÍÊÇSSHÔõÑùÉèÖÃGitµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±ÊµÊ±ÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
¡¾ÍøÕ¾µØͼ¡¿¡¾sitemap¡¿