dzÎöxcodeÉÏÔõôװÖÃgit
gitÊÇÒ»ÖÖºÜÊÇÊ¢Ðеİ汾¿ØÖƹ¤¾ß£¬Ðí¶à¿ª·¢Ö°Ô±¶¼ÔÚʹÓÃËü¾ÙÐдúÂëÖÎÀí¡£ÈôÊÇÄãÊÇÒ»Ãûios¿ª·¢Ö°Ô±£¬ÄÇôÄãÐèҪʹÓÃxcodeÀ´¾ÙÐдúÂë±àдºÍµ÷ÊÔ¡£ÎªÁ˽«git¼¯³Éµ½ÄãµÄxcodeÏîÄ¿ÖУ¬ÄãÐèÒª½«git×°Öõ½ÄãµÄmacÉÏ¡£±¾ÎĽ«ÏÈÈÝÔõÑù´Óxcode×°ÖÃgit¡£
µÚÒ»²½£º×°ÖÃXcode
Ê×ÏÈ£¬ÄãÐèҪװÖÃXcode¡£ÈôÊÇÄ㻹ûÓÐ×°ÖÃËü£¬¿ÉÒÔÔÚApp StoreÖÐËÑË÷Xcode²¢ÏÂÔØ×°Öá£
µÚ¶þ²½£º·¿ªÖÕ¶Ë
·¿ªMacÉϵÄÖÕ¶ËÓ¦ÓóÌÐò¡£Äã¿ÉÒÔÔÚApplications -> Utilities -> TerminalÖÐÕÒµ½Ëü£¬»òÕßʹÓÃSpotlightËÑË÷¡£
µÚÈý²½£º×°ÖÃXcodeÏÂÁîÐй¤¾ß
ÔÚÖÕ¶ËÖÐÊäÈëÒÔÏÂÏÂÁ
xcode-select --install
µÇ¼ºó¸´ÖÆ
È»ºóÄã»á¿´µ½ÈçϵÄÌáÐÑ£º
xcode-select: note: install requested for command line developer tools
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
°´¡°×°Öá±°´Å¥£¬Íê³É×°Öúó¼ÌÐøÏÂÒ»²½¡£
µÚËIJ½£º×°ÖÃGit
ÔÚÖÕ¶ËÖÐÊäÈëÒÔÏÂÏÂÁ
git --version
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ÈôÊÇÄãÒѾװÖÃÁËGit£¬Ä㽫¿´µ½ÀàËÆÏÂÃæµÄÊä³ö£º
git version 2.28.0 (Apple Git-128)
µÇ¼ºó¸´ÖÆ
ÈôÊÇÄ㻹ûÓÐ×°ÖÃGit£¬Öն˻áÌáÐÑÄ㣺
xcode-select: note: install requested for command line developer tools
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ƾ֤ÌáÐÑ×°ÖÃGit¼´¿É¡£
µÚÎå²½£º²âÊÔGitÊÇ·ñ×°ÖÃÀÖ³É
ÔÚÖÕ¶ËÖÐÊäÈëÒÔÏÂÏÂÁ
git --version
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ÈôÊÇÄã¿´µ½Êä³öÁËgit°æ±¾ÐÅÏ¢£¬ËµÃ÷GitÒѾÀÖ³É×°Öò¢ÉèÖõ½ÄãµÄMacÉÏ¡£
½ÓÏÂÀ´£¬Äã¿ÉÒÔÔÚXcodeµÄÉèÖÃÖÐÕÒµ½Git£¬²¢½«ÆäÓëÄãµÄÏîÄ¿¼¯³É¡£ÔÚXcode²Ëµ¥ÖУ¬Ñ¡ÔñXcode -> Preferences -> Accounts¡£µã»÷×óϽǵġ°+¡±°´Å¥£¬Ìí¼ÓÄãµÄGitHubÕ˺š£È»ºó£¬ÔÚXcodeÖÐÑ¡ÔñFile -> Source Control -> Create Git Repositiory£¬½¨ÉèÒ»¸öеÄGit¿ÍÕ»£¬²¢½«ÄãµÄ´úÂëÌá½»µ½¿ÍÕ»ÖС£
×ܽá
ÔÚ±¾ÎÄÖУ¬ÎÒÃÇÏÈÈÝÁËÔõÑù´ÓXcode×°ÖÃGit¡£Ê×ÏÈ£¬ÄãÐèҪװÖÃXcodeºÍXcodeÏÂÁîÐй¤¾ß¡£È»ºó£¬Ê¹ÓÃÖÕ¶ËÖеÄÏÂÁî×°ÖÃGit²¢²âÊÔÊÇ·ñ×°ÖÃÀֳɡ£Íê³Éºó£¬Äã¾Í¿ÉÒÔÔÚXcodeÖн«GitÓëÄãµÄÏîÄ¿¼¯³É£¬¾ÙÐа汾¿ØÖƺʹúÂëÖÎÀíÁË¡£Í¨¹ýʹÓÃGit£¬Äã¿ÉÒÔ¸üºÃµØÖÎÀíÄãµÄ´úÂ룬×èÖ¹ÒâÍâɥʧ´úÂ룬´Ó¶øÌá¸ßÄãµÄ¿ª·¢Ð§ÂÊ¡£
ÒÔÉϾÍÊÇdzÎöxcodeÉÏÔõôװÖÃgitµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡