git·ûºÅ»òÀ಻±£´æÔõô°ì
Ëæ×ÅÈí¼þ¿ª¿¯ÐÐÒµµÄÒ»Ö±Éú³¤ºÍÁ¢Ò죬°æ±¾¿ØÖƹ¤¾ßÒ²Öð½¥³ÉΪÁËÈí¼þÍŶӱز»¿ÉÉÙµÄÒ»²¿·Ö¡£git×÷ΪĿ½ñ×îÊ¢Ðеİ汾¿ØÖƹ¤¾ßÖ®Ò»£¬Æ侫Á·¡¢¸ßЧµÄÌصãÊܵ½ÁËÖڶ࿪·¢ÕߵĽӴý¡£¿ÉÊÇ£¬ÔÚʹÓÃgitµÄÀú³ÌÖУ¬ÓÐʱ»áÓöµ½Ò»Ð©ÎÊÌ⣬ºÃ±Ègit·ûºÅ»òÀ಻±£´æ¡£±¾ÎĽ«Õë¶ÔÕâ¸öÎÊÌâ¾ÙÐÐ̽ÌÖÏ¢Õù´ð¡£
Ò»¡¢ÎÊÌâÅä¾°
ÔÚʹÓÃGitʱ£¬ÓÐʱ¼ä»áÓöµ½ÖîÈç¡°git·ûºÅ»òÀ಻±£´æ¡±µÄ¹ýʧÌáÐÑ¡£ÕâÖÖÇéÐÎÒ»Ñùƽ³£·ºÆðÔÚʹÓÃGit¾ÙÐдúÂëÌá½»¡¢Çл»·ÖÖ§¡¢ºÏ²¢´úÂëµÈ²Ù×÷ʱ£¬¸øÎÒÃÇ´øÀ´ÁËδ±ãºÍÀ§ÈÅ¡£
¶þ¡¢ÎÊÌâÆÊÎö
·ºÆðÕâÖÖÎÊÌ⣬ͨ³£ÓÐÒÔϼ¸ÖÖÔµ¹ÊÔÓÉ£º
Git×°ÖÃÎÊÌ⣺ÈôÊÇGitûÓÐ׼ȷװÖ㬻òÕß×°Öð汾²»Æ¥Å䣬¾Í¿ÉÄÜ·ºÆð¡°git·ûºÅ»òÀ಻±£´æ¡±µÄ¹ýʧÌáÐÑ¡£
ÇéÐαäÁ¿ÉèÖÃÎÊÌ⣺ÈôÊÇGitµÄÏà¹ØÇéÐαäÁ¿Ã»ÓÐ׼ȷÉèÖã¬Ò²»áµ¼ÖÂÀàËƹýʧµÄÌáÐÑ¡£
GitÉèÖÃÎļþÎÊÌ⣺GitÉèÖÃÎļþÖпÉÄÜ°üÀ¨ÓйýʧµÄÉèÖ㬺ñÈÉèÖÃÎļþÖеÄ·¾¶²»×¼È·µÈµÈ£¬»áµ¼ÖÂGitÎÞ·¨Õý³£ÔËÐС£
Git°æ±¾ÎÊÌ⣺²î±ð°æ±¾µÄGitÖ§³ÖµÄ¹¦Ð§ºÍÏÂÁî¿ÉÄܲî±ð£¬ÈôÊÇÔڵͰ汾µÄGitÖÐʹÓÃÁ˸߰汾µÄÏÂÁҲ»á±¬·¢ÀàËƹýʧµÄÌáÐÑ¡£
ÆäËûÔµ¹ÊÔÓÉ£ººÃ±È²Ù×÷ϵͳÎÊÌâ¡¢ÍøÂçÅþÁ¬ÎÊÌâµÈ¡£
Èý¡¢½â¾ö¼Æ»®
Õë¶Ô²î±ðµÄÔµ¹ÊÔÓÉ£¬ÎÒÃÇ¿ÉÒÔ½ÓÄɲî±ðµÄ½â¾ö¼Æ»®¡£
Git×°ÖÃÎÊÌâ
ÈôÊÇGitûÓÐ׼ȷװÖûòÕß×°Öð汾²»Æ¥Å䣬ÎÒÃÇÐèÒªÖØмì²éºÍ×°Öá£ÔÚ×°ÖÃÀú³ÌÖУ¬Òª×¢ÖØÑ¡ÔñÏìÓ¦µÄ²Ù×÷ϵͳºÍ°æ±¾£¬È·±£Óë×Ô¼ºµÄµçÄÔÆ¥Å䡣ͬʱ£¬»¹ÒªÌØÊâ×¢Öع´Ñ¡¡°½«GitÌí¼Óµ½ÏµÍ³PATHÇéÐαäÁ¿ÖС±Ñ¡Ïî¡£ÕâÑù¿ÉÒÔ×ÊÖúÎÒÃÇ×Ô¶¯ÉèÖÃGitµÄÇéÐαäÁ¿£¬×èÖ¹·ºÆðÀàËƹýʧÌáÐѵÄÎÊÌâ¡£
ÇéÐαäÁ¿ÉèÖÃÎÊÌâ
µ±ÎÒÃÇÓöµ½¡°git·ûºÅ»òÀ಻±£´æ¡±µÄ¹ýʧÌáÐÑʱ£¬¿ÉÒÔ¼ì²éÎÒÃǵÄÇéÐαäÁ¿ÉèÖÃÊÇ·ñ׼ȷ¡£ÔÚWindows²Ù×÷ϵͳÖУ¬·¿ª¡°¿ØÖÆÃæ°å¡±->¡°ÏµÍ³ºÍÇå¾²¡±->¡°ÏµÍ³¡±->¡°¸ß¼¶ÏµÍ³ÉèÖá±->¡°ÇéÐαäÁ¿¡±½çÃ棬ÔÚϵͳ±äÁ¿ÖÐÕÒµ½PATH±äÁ¿£¬È·±£GitµÄ×°ÖÃĿ¼±»×¼È·Ìí¼Ó¡£ÈôÊÇ·¢Ã÷ÎÊÌ⣬ÎÒÃÇÐèÒªÊÖ¶¯ÐÞ¸ÄÇéÐαäÁ¿£¬Ìí¼ÓGitµÄ×°ÖÃĿ¼¡£
GitÉèÖÃÎļþÎÊÌâ
ÈôÊÇGitÉèÖÃÎļþÖб£´æÎÊÌ⣬ÎÒÃÇ¿ÉÒÔͨ¹ýÒÔÏÂÒªÁì½â¾ö£º
£¨1£©·¿ªGit Bash£¬ÔÚÏÂÁîÐÐÖÐÊäÈë¡°git config –list¡±£¬Éó²éÒÑÓеÄÉèÖÃ;
£¨2£©ÈôÊÇ·¢Ã÷ÓÐÉèÖÃÎļþÖз¾¶²»×¼È·£¬¿ÉÒÔʹÓá°git config –global [Ñ¡Ïî] [²ÎÊý]¡±ÏÂÁîÐÞ¸ÄÉèÖÃÎļþ£¬ÀýÈ磺ÐÞ¸Äuser.nameºÍuser.emailµÄÉèÖãº
git config –global user.name “your name”
git config –global user.email “your_email@example.com”
Git°æ±¾ÎÊÌâ
ÈôÊÇGit°æ±¾²»Æ¥Å䣬ÎÒÃÇÐèÒª¼ì²éÄ¿½ñËùʹÓõÄGit°æ±¾ÊÇ·ñÖ§³ÖÎÒÃÇËùÐèÒªµÄ²Ù×÷¡£Í¬Ê±£¬Ò²¿ÉÒÔʵÑéÉý¼¶Git°æ±¾£¬Ê¹ÆäÓëÎÒÃÇËùÐèµÄÏÂÁîºÍ¹¦Ð§ÏàÆ¥Åä¡£
ÆäËûÔµ¹ÊÔÓÉ
ÈôÊÇÒÔÉÏÒªÁ춼ÎÞ·¨½â¾öÎÊÌ⣬ÎÒÃÇ¿ÉÒÔ˼Á¿ÒÔϼ¸µã£º
£¨1£©Éó²é²Ù×÷ϵͳºÍÍøÂçÅþÁ¬ÊÇ·ñÕý³£;
£¨2£©¼ì²éGit×°ÖÃÊÇ·ñ׼ȷ£¬Ä¿Â¼½á¹¹ÊÇ·ñÇкϹ淶;
£¨3£©°´ÐèÖØÆôÅÌËã»ú£¬¼ì²éGitÊÇ·ñÄܹ»Õý³£ÔËÐС£
×ܵÄÀ´Ëµ£¬½â¾ö¡°git·ûºÅ»òÀ಻±£´æ¡±µÄÎÊÌâÐèÒªÎÒÃÇ´Ó¶à¸ö·½Ãæ×ÛºÏ˼Á¿ºÍʵÑé¡£ÎÒÃÇÐèÒª¶ÔGitÓÐÒ»¶¨µÄÏàʶ£¬²¢Äܹ»ÊìÁ·ÕÆÎÕһЩ»ù±¾µÄÏÂÁîºÍ²Ù×÷¡£ÔÚÓöµ½ÎÊÌâʱ£¬ÎÒÃÇÐèÒªÈÏÕæÆÊÎöºÍÅŲ飬½ÓÄɺÏÊʵÄÒªÁì½â¾ö£¬ÒÔ°ü¹ÜGit¹¤¾ßµÄÕý³£Ê¹Óá£
ÒÔÉϾÍÊÇgit·ûºÅ»òÀ಻±£´æÔõô°ìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡