Ïê½âgitÖÐÔõôÉó²é³åÍ»
ÔÚÍŶÓÐ×÷ÖУ¬git ÊǷǾ³£Óõİ汾¿ØÖƹ¤¾ß¡£¿ÉÊÇÔÚ¶àÈËͬʱÐÞ¸Äͳһ¸öÎļþ»òÕßͳһ¸ö´úÂë¿âʱ£¬¾Í¿ÉÄÜ·ºÆð³åÍ»¡£ÈôÊÇÓÐÈËÔÚÍâµØÒѾÐÞ¸ÄÁËij¸öÎļþ²¢Ìá½»ÁË£¬µ«ÁíһСÎÒ˽ÈËÔÚÔ¶³ÌÒ²ÐÞ¸ÄÁËÕâ¸öÎļþ²¢Ìá½»ÁË£¬Õâʱ¼ä¾Í»á·ºÆð³åÍ»¡£
ÄÇôÔÚ Git ÖУ¬ÔõÑùÉó²é³åÍ»ÄØ£¿ÏÂÃæÎÒÃǾÍÀ´ÏÈÈÝһϡ£
¼ì²éÊÇ·ñ±£´æ³åÍ»
ÔÚ Git ÖУ¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁî¼ì²éÄ¿½ñÎļþÊÇ·ñ±£´æ³åÍ»£º
$ git status
µÇ¼ºó¸´ÖÆ
ÈôÊÇ·ºÆðÀàËÆÈçÏÂÊä³ö£¬Ôò˵Ã÷Ä¿½ñÎļþ±£´æ³åÍ»£º
On branch master You have unmerged paths. (fix conflicts and run "git commit")
µÇ¼ºó¸´ÖÆ
Éó²é³åÍ»Îļþ
ÔÚ¼ì²é³ö±£´æ³åÍ»ºó£¬ÎÒÃÇÐèÒªÉó²éÏêϸÄÄЩÎļþ±£´æ³åÍ»£¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÉó²é£º
$ git diff --name-only --diff-filter=U
µÇ¼ºó¸´ÖÆ
ÆäÖÐ –name-only ²ÎÊýÌåÏÖÖ»ÏÔʾÎļþÃû£¬–diff-filter=U ²ÎÊýÌåÏÖÏÔʾ³åÍ»Îļþ¡£
½â¾ö³åÍ»
ͨ¹ýÉó²é³åÍ»Îļþ£¬ÎÒÃÇ¿ÉÒÔÖªµÀÄÄЩÎļþ±£´æ³åÍ»¡£½ÓÏÂÀ´£¬ÎÒÃÇÐèÒªÊÖ¶¯È¥½â¾ö³åÍ»¡£
Ê×ÏÈ£¬ÎÒÃÇÐèÒª·¿ª±£´æ³åÍ»µÄÎļþ£¬ÏêϸµÄ³åͻλÖûáÓÃÌØÊâµÄ·ûºÅ±ê¼Ç³öÀ´£¬ÀýÈ磺
>>>>>> branch_name
µÇ¼ºó¸´ÖÆ
>>>>>> branch_name Ö®¼äÌåÏÖÔ¶³ÌÐ޸ĵÄÄÚÈÝ¡£
ÎÒÃÇÐèҪƾ֤ÏÖÕæÏàÐÎÑ¡Ôñ±£´æÄÄÒ»²¿·Ö»òÕß¾ÙÐÐÊÖ¶¯ºÏ²¢¡£ºÏ²¢Íê³Éºó£¬ÔÙ´ÎÌá½»Ð޸ļ´¿É½â¾ö³åÍ»¡£
Ìá½»½â¾ö¼Æ»®
µ±³åÍ»½â¾öÍê³Éºó£¬ÎÒÃÇÐèҪͨ¹ýÒÔÏÂÏÂÁîÌá½»½â¾ö¼Æ»®£º
$ git add <file_name> $ git commit</file_name>
µÇ¼ºó¸´ÖÆ
ÆäÖÐ ÊDZ£´æ³åÍ»µÄÎļþÃû¡£
Éó²éÌá½»ÀúÊ·
×îºó£¬ÎÒÃÇ¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÉó²éÌá½»ÀúÊ·£º
$ git log
µÇ¼ºó¸´ÖÆ
ÈôÊÇÏÔʾ Merge branch ‘ ‘£¬Ôò˵Ã÷³åÍ»ÒѾÀֳɽâ¾ö¡£
×ܽá
ÔÚÍŶÓÐ×÷ÖУ¬³åÍ»Êdz£¼ûµÄÎÊÌ⡣ͨ¹ýÉÏÊöÏÈÈÝ£¬ÎÒÃÇ¿ÉÒÔÔÚ Git ÖÐÏàʶÔõÑùÉó²é³åÍ»¡¢½â¾ö³åÍ»²¢Ìá½»½â¾ö¼Æ»®¡£ÔÚÏÖʵ¿ª·¢ÖУ¬ÊµÊ±µÄ½â¾ö³åÍ»¿ÉÒÔÌá¸ßÍŶÓÐ×÷ЧÂÊ£¬¸üºÃµÄÍƽøÏîÄ¿Ï£Íû¡£
ÒÔÉϾÍÊÇÏê½âgitÖÐÔõôÉó²é³åÍ»µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡