idea git ÂÒÂëÔõô°ì
ideaÖÐgit´úÂëÂÒÂëÎÊÌâ½â¾ö¼Æ»®
ÔÚʹÓÃIdea¾ÙÐÐGit´úÂëÖÎÀíʱ£¬ÎÒÃdz£³£»áÓöµ½´úÂëÂÒÂëµÄÎÊÌâ¡£Õâ¸öÎÊÌâ¸ø³ÌÐòÔ±µÄÊÂÇé´øÀ´ÁËÐí¶àδ±ã¡£±¾ÎĽ«Õë¶ÔÕâ¸öÎÊÌ⣬Ϊ¸÷ÈËÏÈÈÝһЩ½â¾ö¼Æ»®¡£
Ò»¡¢ÎÊÌâȪԴÆÊÎö
IdeaÖÐGit´úÂëÂÒÂëÎÊÌâµÄ»ù´¡Ôµ¹ÊÔÓÉÊÇÎļþ±àÂëÃûÌÃÉèÖò»×¼È·¡£ÎÒÃÇÖªµÀ£¬³ÌÐòÔ±ÔÚ±àд´úÂëʱÐèÒª×ñÕÕÒ»¶¨µÄ±àÂë¹æ·¶£¬ÀýÈçUTF-8¡¢GBKµÈ¡£ÈôÊÇÔÚIdeaÖеÄGit´úÂëÖÎÀí¹¤¾ßÖÐÎļþ±àÂëÃûÌÃÓëÏÖʵ²»·û£¬¾Í»áÒýÆð´úÂëÂÒÂëÎÊÌâ¡£
¶þ¡¢½â¾ö¼Æ»®
1¡¢ÉèÖÃIdea±àÂë·½·¨
ÔÚIdeaÖУ¬ÎÒÃÇ¿ÉÒÔͨ¹ýÒÔÏ°취ÉèÖñàÂë·½·¨£º
File -> Settings -> Editor -> File Encoding
È»ºóÎÒÃÇÑ¡ÔñºÏÊʵıàÂë·½·¨¡£Æ¾Ö¤²î±ðµÄÍŶӡ¢ÏîÄ¿ºÍÏ°¹ß£¬ÎÒÃÇ¿ÉÒÔÑ¡ÔñUTF-8¡¢GBKµÈÃûÌá£ÉèÖúúó£¬ÎÒÃÇÔÙ´ÎÉó²é´úÂëÊÇ·ñÕý³£ÏÔʾ¡£
2¡¢ÉèÖÃGit±àÂë·½·¨
ÔÚIdeaÖУ¬GitÒ²ÓÐ×Ô¼ºµÄ±àÂë·½·¨¡£ÎÒÃÇÐèÒª½«Á½ÕߵıàÂë·½·¨Í³Ò»¡£Ïêϸ°ì·¨ÈçÏ£º
File -> Settings -> Version Control -> Git -> Global configuration
·¿ª Git ÉèÖã¬ÕÒµ½ core.autocrlf ºÍ core.safecrlf ÊôÐÔ¡£½«ËüÃǵÄÖµ¶¼ÉèÖÃΪ false£¬ÉúÑÄÍ˳ö¼´¿É¡£
3¡¢×ª»»Îļþ±àÂëÃûÌÃ
ÔÚÏÖʵÊÂÇéÖУ¬ÎÒÃÇ¿ÉÄÜ»áÓöµ½´úÂëÖÐÒѾ·ºÆðÁËÂÒÂ룬Õâʱ¼äÎÒÃÇ¿ÉÒÔ¾ÙÐдúÂë±àÂëת»»¡£Ïêϸ°ì·¨ÈçÏ£º
·¿ªÐèҪת»»µÄÎļþ£¬ÒÀ´ÎÑ¡ÔñFile -> File Encoding -> Convert Encoding
ÔÚConvert File Encoding¶Ô»°¿òÖУ¬Ñ¡ÔñÄ¿µÄ±àÂë·½·¨£¬ÀýÈçUTF-8
µã»÷OK£¬ÉúÑÄÎļþ
4¡¢Ê¹ÓÃÎı¾±à¼Æ÷¾ÙÐдúÂë´¦Àí
ÈôÊÇÒÔÉÏÈýÖÖÒªÁ춼²»¿É½â¾öÎÒÃǵÄÎÊÌ⣬ÎÒÃÇ¿ÉÒÔ˼Á¿Ê¹ÓÃÎı¾±à¼Æ÷¾ÙÐдúÂë´¦Àí¡£Îı¾±à¼Æ÷±ÈIdea¸üרҵ£¬¿ÉÒÔ¸ü¾«×¼µØ¶Ô´úÂë¾ÙÐбàÂëת»»ºÍÏÔʾ¡£ÍƼöʹÓÃNotepad++µÈרҵÎı¾±à¼Æ÷¡£
×ÜÖ®£¬Í¨¹ýÒÔÉÏÒªÁìÎÒÃÇ¿ÉÒÔ½â¾öGit´úÂëÂÒÂëµÄÎÊÌ⣬ÈóÌÐòÔ±Äܹ»Ô½·¢ÇáËɵؾÙÐдúÂëÖÎÀíºÍÐ×÷¡£ËäÈ»£¬ÔÚÏÖʵÊÂÇéÖУ¬ÎÒÃÇÒ²Ó¦¸Ã×ñÕÕÒ»¶¨µÄ±àÂë¹æ·¶£¬ïÔÌ´úÂë·ºÆðÂÒÂëµÄ¿ÉÄÜÐÔ¡£
ÒÔÉϾÍÊÇidea git ÂÒÂëÔõô°ìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡