×ðÁú¿­Ê±

macÔõôװÖÃgithub

mac ϵͳÏÂ×°Öà github

GitHub ÊdzÌÐòÔ±Ãdz£ÓõĴúÂëÍйÜƽ̨֮һ  £¬Ëü²»µ«ÌṩÁËÃâ·ÑµÄ´úÂëÍйÜЧÀÍ  £¬»¹¿ÉÒÔͨ¹ý Pull Request¡¢Issues µÈ¹¦Ð§ÊµÏÖÍŶÓЭ×÷¿ª·¢¡£ÏÂÃæÏÈÈÝÔÚ Mac ϵͳÏÂÔõÑù×°Öà GitHub¡£

°ì·¨Ò»£ºÏÂÔØ×°Öà Git

Ê×ÏÈ  £¬Òª×°Öà Git  £¬ÓÉÓÚ Git ÊÇ GitHub ʹÓõİ汾¿ØÖƹ¤¾ß¡£·­¿ªÖÕ¶Ë  £¬ÊäÈëÒÔÏÂÏÂÁ

$ brew install git

µÇ¼ºó¸´ÖÆ

ÈôÊÇûÓÐ×°Öà Homebrew  £¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî×°Öãº

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

µÇ¼ºó¸´ÖÆ

×°ÖÃÍê³Éºó  £¬¿ÉÒÔÊäÈëÒÔÏÂÏÂÁî¼ì²é Git ÊÇ·ñÒѾ­ÀÖ³É×°Öãº

$ git --version

µÇ¼ºó¸´ÖÆ

ÈôÊÇ·ºÆð Git °æ±¾ÐÅÏ¢  £¬ËµÃ÷ Git ×°ÖÃÀֳɡ£

°ì·¨¶þ£ºÌìÉú SSH ÃÜÔ¿

½ÓÏÂÀ´  £¬ÐèÒª½¨ÉèÓë GitHub ЧÀÍÆ÷Ö®¼äµÄ SSH ÅþÁ¬  £¬ÓÃÓÚÉí·ÝÑéÖ¤  £¬ÒÔÈ·±£ÄúµÄ´úÂë±»´«Êäµ½ºÏÊʵĿÍÕ»¡£

ÔÚÖÕ¶ËÖÐ  £¬ÊäÈëÒÔÏÂÏÂÁ

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

µÇ¼ºó¸´ÖÆ

Õâ¸öÏÂÁî»áʹÓà RSA Ëã·¨ÌìÉúÒ»¸ö³¤¶ÈΪ 4096 µÄ SSH ÃÜÔ¿  £¬ÆäÖÐ “your_email@example.com” Ó¦Ì滻ΪÄã×Ô¼ºµÄµç×ÓÓʼþµØµã¡£ÔÚ´ËÀú³ÌÖÐ  £¬¿ÉÒÔÊäÈëÔÊÐí»ò²»ÔÊÐí SSH »á¼ûµÄÃÜÂë  £¬»òÕßƾ֤СÎÒ˽¼ÒÐèÇóÖ±½Ó°´»Ø³µÌø¹ý¡£

µ±ÃÜÔ¿ÌìÉúºó  £¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÉó²é²¢¸´ÖÆÄúµÄ¹«Ô¿£º

$ cat ~/.ssh/id_rsa.pub

µÇ¼ºó¸´ÖÆ

°ì·¨Èý£ºÌí¼Ó SSH ÃÜÔ¿

½ÓÏÂÀ´  £¬½«¹«Ô¿Ìí¼Óµ½ GitHub ÉÏ  £¬ÒÔÔÊÐí GitHub ÅбðÄúµÄÍâµØÅÌËã»úÒÔ¼°ÔÊÐíÄú»á¼ûÓëÄúµÄÕÊ»§¹ØÁªµÄ´æ´¢¿â¡£

µÇ¼ GitHub ÕÊ»§  £¬µ¥»÷Í·Ïñ  £¬È»ºóÑ¡Ôñ¡°Settings¡±£¨ÉèÖã©¡£Ñ¡Ôñ×ó²àµ¼º½Öеġ°SSH keys¡±£¨SSH ÃÜÔ¿£©²¢µ¥»÷¡°Add SSH Key¡±£¨Ìí¼Ó SSH ÃÜÔ¿£©¡£

ÔÚ¡°Title¡±×Ö¶ÎÖÐÊäÈëÒ»¸öÃû³Æ  £¬È»ºóÔÚ¡°Key¡±×Ö¶ÎÖÐÕ³Ìù¹«Ô¿¡£×îºó  £¬µ¥»÷¡°Add SSH Key¡± °´Å¥¼´¿É¡£

°ì·¨ËÄ£ºÑéÖ¤ SSH ÅþÁ¬

Ìí¼Ó SSH ÃÜÔ¿ºó  £¬¿ÉÒÔÑéÖ¤ SSH ÅþÁ¬ÊÇ·ñÀֳɡ£ÔÚÖÕ¶ËÖÐÊäÈëÒÔÏÂÏÂÁ

$ ssh -T git@github.com

µÇ¼ºó¸´ÖÆ

ÈôÊÇÅþÁ¬ÀÖ³É  £¬»á·ºÆðÒÔÏÂÀàËƵÄÊä³ö£º

Hi username! You've successfully authenticated, but GitHub does not provide shell access.

µÇ¼ºó¸´ÖÆ

°ì·¨Î壺ÉèÖà Git Óû§ÃûºÍÓÊÏä

È·±£ÄúÒѾ­ÉèÖÃÁËÍâµØ Git Óû§ÃûºÍÓÊÏä  £¬ÓÉÓÚÕâЩÐÅÏ¢½«±»¼Í¼ΪÌá½»µÄÀúÊ·ÐÅÏ¢Ö®Ò»¡£ÔÚÖÕ¶ËÖÐÊäÈëÒÔÏÂÏÂÁîÀ´ÉèÖÃÄúµÄÓû§ÃûºÍµç×ÓÓʼþ£º

$ git config --global user.name "Your Name"
$ git config --global user.email "your_email@example.com"

µÇ¼ºó¸´ÖÆ

ÏÖÔÚÄúÒѾ­ÀÖ³É×°Öò¢ÉèÖÃÁË GitHub¡£¿ÉÒÔͨ¹ý Git ÏÂÁîÐлòʹÓà Git ¿Í»§¶ËÀ´Óë GitHub ¿ÍÕ»¾ÙÐÐЭ×÷¡£

½áÂÛ

ÒÔÉϾÍÊÇÔÚ mac ϵͳÏÂ×°Öà github µÄÕû¸öÀú³Ì¡£×°Öà Git¡¢ÌìÉú SSH ÃÜÔ¿¡¢Ìí¼Ó SSH ÃÜÔ¿¡¢ÑéÖ¤ SSH ÅþÁ¬¡¢ÉèÖà Git Óû§ÃûºÍÓÊÏäÕâЩ°ì·¨  £¬¶¼ÊDZز»¿ÉÉٵġ£Í¨¹ýÕâÑù×°ÖúÍÉèÖà  £¬Äã¿ÉÒÔÔÚÍâµØÅÌËã»úÉÏÓä¿ìµØÓë GitHub ¿ÍÕ»¾ÙÐÐЭ×÷¿ª·¢¡£

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

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

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