尊龙凯时人生就是博

ÔõôÉèÖà git ±àÂë

Ëæ׎ü¼¸Äê°æ±¾¿ØÖƹ¤¾ßµÄÆÕ±éÓ¦Óà £¬git ÒѾ­³ÉΪ¿ª·¢ÕßÃDZز»¿ÉÉٵŤ¾ßÖ®Ò»¡£×÷Ϊһ¿îÓÅÒìµÄ°æ±¾¿ØÖƹ¤¾ß £¬git µÄÆÕ±éÓ¦ÓÃÒ²Ìá¸ßÁ˱à³ÌµÄЧÂʺʹúÂëµÄ¿Éά»¤ÐÔ¡£²»¹ý £¬Ê¹Óà git µÄʱ¼äÒ²¾­³£Óöµ½Ò»Ð©ÎÊÌâ £¬ÆäÖÐÒ»¸ö³£¼ûµÄÎÊÌâ¾ÍÊDZàÂëÎÊÌâ¡£±¾ÎĽ«ÖصãÏÈÈÝÔõÑùÉèÖà git ±àÂë £¬×ÊÖú¸÷È˸üºÃµØʹÓà git¡£

Ò»¡¢Git µÄ±àÂëÎÊÌâ

Git µÄ±àÂëÎÊÌâÖ÷ÒªÌåÏÖÔÚÁ½¸ö·½Ã棺ÎļþÃû±àÂëºÍÎı¾Îļþ±àÂë¡£ÆäÖÐ £¬ÎļþÃû±àÂëÖ÷ÒªÖ¸µÄÊÇÎļþÃûÖпÉÄÜ°üÀ¨·Ç ASCII Âë×Ö·ûµÄÎÊÌâ¡£ÔÚ Windows ϵͳÏ £¬ÎļþÃûĬÈÏÊǽÓÄÉ GBK ±àÂëµÄ £¬¶øÔÚ Linux ºÍ MacOS ϵͳÏ £¬ÔòÊǽÓÄÉ UTF-8 ±àÂëµÄ¡£µ±ÎÒÃÇÔÚʹÓà Git ¾ÙÐа汾¿ØÖÆʱ £¬ÈôÊÇʹÓÃÁ˲î±ð±àÂëµÄϵͳ»òÕß²î±ð±àÂëµÄÎļþÃû £¬¾Í¿ÉÄ᷺ܻÆðÎļþÃû»ò·¾¶²»¿É±»×¼È·ÆÊÎöµÄÎÊÌâ¡£

Îı¾Îļþ±àÂëÊÇÖ¸Îı¾ÎļþÖÐ×Ö·û±àÂëµÄÎÊÌâ¡£ÔÚ²î±ðµÄ±àÂëÃûÌÃÖÐ £¬Í¬ÑùµÄ×Ö·û¿ÉÄܻᱻ´æ´¢Îª²î±ðµÄ¶þ½øÖÆÂëÖµ £¬Õâ¾Í¿ÉÄܵ¼ÖÂÔÚ²î±ðµÄϵͳ»òÈí¼þÖÐÎļþ·­¿ªÊ±·ºÆðÂÒÂëµÄÇéÐΡ£¶øÔÚ Git ÖÐ £¬ÈôÊÇÎı¾ÎļþµÄ±àÂëÃûÌÃÓëϵͳÇéÐβ»Æ¥Åä £¬ÔòÔÚÉó²é¡¢±à¼­µÈ²Ù×÷ʱҲ»á·ºÆðÂÒÂëÎÊÌâ¡£

¶þ¡¢ÉèÖÃÎļþÃû±àÂë

Õë¶ÔÎļþÃû±àÂëÎÊÌâ £¬ÎÒÃÇÐèÒªÉèÖà Git µÄ core.quotepath ÉèÖòÎÊý¡£¸Ã²ÎÊýÓÃÓÚ¾öÒéÊÇ·ñ¶ÔÎļþ·¾¶¾ÙÐбàÂë¡£ÔÚ Windows ϵͳÏ £¬¸Ã²ÎÊýµÄĬÈÏÖµÊÇ true £¬¼´Ç¿ÖƶÔÎļþÃû¾ÙÐбàÂë´¦Àí¡£µ«ÔÚ Linux ºÍ MacOS ϵͳÏ £¬¸Ã²ÎÊýµÄĬÈÏÖµÊÇ false £¬¼´²î³ØÎļþÃû¾ÙÐбàÂë´¦Àí¡£Òò´Ë £¬ÈôÊÇÎÒÃÇÔÚ Windows ϵͳºÍ Linux/MacOS ϵͳ֮¼ä¾ÙÐдúÂë¹²Ïíʱ £¬¾ÍÐèҪעÖØÉèÖøòÎÊý¡£

ÎÒÃÇ¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´ÉèÖøòÎÊý£º

git config --global core.quotepath false

µÇ¼ºó¸´ÖÆ

ÈôÊÇÐèÒª»Ö¸´Ä¬ÈÏÉèÖà £¬Ôò¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

git config --global core.quotepath true

µÇ¼ºó¸´ÖÆ

Èý¡¢ÉèÖÃÎı¾Îļþ±àÂë

ÔÚÉèÖÃÎı¾Îļþ±àÂëʱ £¬ÎÒÃÇÐèҪעÖØÁ½¸ö·½Ã棺ȫ¾ÖÉèÖú͵¥¸öÎļþÉèÖá£

È«¾ÖÉèÖÃ

ÎÒÃÇ¿ÉÒÔͨ¹ýÉèÖà Git µÄ git config ²ÎÊýÀ´ÉèÖÃÈ«¾ÖĬÈϵÄÎı¾Îļþ±àÂë¡£ÔÚ Git ÖÐ £¬ÓÐÁ½¸öÏà¹Ø²ÎÊý£ºcore.autocrlf ºÍ core.safecrlf¡£

core.autocrlf ²ÎÊýÓÃÓÚ¿ØÖÆ»»ÐзûµÄת»»¡£ÔÚ Windows ϵͳÖÐ £¬Ä¬ÈϵÄÎı¾Îļþ»»ÐзûΪ CRLF £¬¶øÔÚ Linux ºÍ MacOS ϵͳÖÐ £¬ÔòΪ LF¡£µ±ÔÚ Git ÖÐÌí¼Ó»òÐÞ¸ÄÎı¾Îļþʱ £¬ÈôÊǸòÎÊýÉèÖÃΪ true £¬Git »á½«ÎļþÖÐµÄ CRLF ת»»Îª LF ²¢´æ´¢ £¬¶øÔÚ´Ó Git Öн«Îļþ checkout ³öÀ´Ê± £¬»á½«ÎļþÖÐµÄ LF ת»»Îª CRLF¡£ÈôÊǸòÎÊýÉèÖÃΪ input £¬Ôò»áÇ¿ÖÆʹÓû»Ðзû LF¡£

ÎÒÃÇ¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´ÉèÖøòÎÊý£º

git config --global core.autocrlf true

µÇ¼ºó¸´ÖÆ

»òÕߣº

git config --global core.autocrlf input

µÇ¼ºó¸´ÖÆ

core.safecrlf ²ÎÊýÓÃÓÚ¼ì²éÎı¾ÎļþµÄ±àÂëÃûÌᣵ±¸Ã²ÎÊýÉèÖÃΪ true ʱ £¬Git »á¼ì²éÎļþÖеĻ»ÐзûÊÇ·ñ׼ȷ £¬ÈôÊÇÎļþÖеĻ»ÐзûÓÐÎÊÌâ £¬Ôò»á×èÖ¹ÎļþµÄÌá½»¡£ÎÒÃÇ¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´ÉèÖøòÎÊý£º

git config --global core.safecrlf true

µÇ¼ºó¸´ÖÆ

µ¥¸öÎļþÉèÖÃ

ÈôÊÇÎÒÃÇÐèÒªÕë¶Ôij¸öÎı¾Îļþ¾ÙÐÐÌØÊâµÄ±àÂëÉèÖà £¬¿ÉÒÔÔÚ¸ÃÎļþËùÔÚµÄ Git ¿ÍÕ»ÖÐÌí¼Ó .gitattributes Îļþ £¬²¢ÔÚ¸ÃÎļþÖоÙÐÐÉèÖá£ÔÚ .gitattributes ÎļþÖÐ £¬ÎÒÃÇ¿ÉÒÔΪÿ¸öÎļþÖ¸¶¨ÎļþÃûºÍÎļþ·¾¶Ä£Ê½ £¬²¢Ö¸¶¨ÏìÓ¦µÄÎı¾ÊôÐԺͱàÂëÃûÌá£ÐèҪעÖصÄÊÇ £¬.gitattributes Îļþ±ØÐèʹÓà UTF-8 ±àÂë¡£

ÀýÈç £¬ÒÔÏÂÉèÖÿÉÒÔΪ PHP ÎļþÖ¸¶¨ UTF-8 ±àÂ룺

*.php  text encoding=utf-8

µÇ¼ºó¸´ÖÆ

ÐèҪעÖصÄÊÇ £¬ÔÚ¾ÙÐе¥¸öÎļþ±àÂëÉèÖÃʱ £¬ÈôÊÇÒѾ­½«¸ÃÎļþ¼ÓÈëµ½ Git ÖÐ £¬ÔòÐèÒªÏȽ«¸ÃÎļþ´Ó Git ÖÐɾ³ý £¬È»ºóÔÙ¾ÙÐбàÂëÉèÖá£

ËÄ¡¢×ܽá

ͨ¹ýÒÔÉϵÄÏÈÈÝ £¬ÎÒÃÇ¿ÉÒÔ¿´µ½ Git µÄ±àÂëÎÊÌâÒ»·½ÃæÊÇÈ¡¾öÓÚϵͳÇéÐεıàÂëÃûÌà £¬ÁíÒ»·½ÃæÔòÊÇÈ¡¾öÓÚÏêϸµÄÎļþ±àÂëÃûÌá£ÎªÁ˸üºÃµØʹÓà Git £¬ÎÒÃÇÐèÒªÏàʶÕâЩ±àÂëÏà¹ØµÄÎÊÌâ £¬²¢Æ¾Ö¤ÏÖÕæÏàÐÎÀ´¾ÙÐÐÏìÓ¦µÄÉèÖᣱ¾ÎÄÖ÷ÒªÏÈÈÝÁË Git ±àÂëÎÊÌâµÄ½â¾ö¼Æ»® £¬Ï£Íû¶Ô¶ÁÕßÓÐËù×ÊÖú¡£

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

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

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

18523999891

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

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

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