git ÔõÑù fork
Ò»¡¢Ê²Ã´ÊÇ git fork£¿
Git Fork£¨·Ö²æ£©ÊÇÖ¸½«ÔÓÐÏîÄ¿µÄ¿ÍÕ»¸´ÖÆÒ»·Ýµ½×Ô¼ºµÄ GitHub ÕË»§Ï£¬´Ó¶ø½¨ÉèÒ»¸öеĿÍÕ»¡£Í¨¹ý Fork£¬Äã¿ÉÒÔ½«±ðÈ˵ÄÏîÄ¿¸´ÖƵ½×Ô¼ºµÄÕË»§Ï¾ÙÐÐÐ޸ġ¢Ðû²¼¡¢·ÖÏíµÈ²Ù×÷£¬²¢ÇÒÕâ¸öеĿÍÕ»ºÍÔÓÐÏîÄ¿ÓµÓÐͬÑùµÄ´úÂëºÍÌá½»¼Í¼¡£
¶þ¡¢ÔõÑù Fork Ò»¸ö¿ÍÕ»£¿
µÇ¼×Ô¼ºµÄ GitHub ÕË»§
ÔÚä¯ÀÀÆ÷ÖÐÊäÈë https://github.com ²¢µÇ¼¡£
ÕÒµ½ÐèÒª Fork µÄ¿ÍÕ»
ÕÒµ½ÏëÒª Fork µÄ¿ÍÕ»£¬ÀýÈç https://github.com/octocat/Spoon-Knife ¡£
Fork ¿ÍÕ»
µã»÷ÓÒÉÏ½ÇµÄ Fork °´Å¥£¬½«¸Ã¿ÍÕ» Fork µ½×Ô¼ºµÄÕË»§Ï¡£
ÆÚ´ý Fork Íê³É
ÔÚ Fork Íê³É֮ǰ£¬Ò³Ãæ»áÒ»Ö±ÏÔʾ¡°Forking¡±×ÖÑù¡£
Èý¡¢ÔõÑù½« Fork ºóµÄ¿Íջͬ²½¸üе½ÔÓпÍÕ»£¿
ͨ³£ÇéÐÎÏ£¬Äã Fork µÄÒ»¸öÏîÄ¿¶¼ÊÇ»ùÓÚÖ÷¿ª·¢ÕßµÄÏîÄ¿£¬ÒÔÊÇÒ»¶Îʱ¼äºó£¬ÔÓеÄÏîÄ¿»áÒ»Ö±¸üУ¬¶øÄãµÄ Fork ÏîÄ¿²¢²»»á×Ô¶¯Í¬²½ÕâЩ¸üÐÂÄÚÈÝ£¬Òò´Ë£¬ÐèÒªÊÖ¶¯½«ÔÓÐÏîÄ¿ÐÞ¸Äͬ²½µ½×Ô¼ºµÄ Fork ÏîÄ¿ÄÚ¡£
ÒÔÏÂÊÇͬ²½ Fork ¿ÍÕ»ÒªÁ죺
Clone Fork 씀½øÈë your_repo Ò³Ã棬µã»÷¡°Clone or download¡±£¬½«Æä Clone µ½ÍâµØ¡£
Ìí¼ÓÔ¶³Ì¿ÍÕ»
ÔÚÍâµØ¿Ë¡µÄ Fork ÏîÄ¿Ï£¬Ö´ÐÐÏÂÁgit remote add upstream Ö÷¿ª·¢ÕßÏîÄ¿µÄµØµã
ÀýÈ磺git remote add upstream https://github.com/octocat/Spoon-Knife.git
ÀÈ¡Ö÷¿ª·¢ÕßµÄÌá½»¼Í¼
Ö´ÐÐÏÂÁgit fetch upstream
Çл»·ÖÖ§²¢ºÏ²¢Ö÷¿ª·¢ÕߵĸüÐÂ
Ö´ÐÐÏÂÁgit checkout master
Ö´ÐÐÏÂÁgit merge upstream/master
Push µ½Ð¡ÎÒ˽¼ÒÕË»§Ï嵀 Fork ¿ÍÕ»
Ö´ÐÐÏÂÁgit push origin master
ÒÔÉϲÙ×÷Íê³Éºó£¬ÄãµÄ Fork ¿ÍÕ»±ãÒѸüе½×îеÄ״̬¡£
ËÄ¡¢ÔõÑùÖÎÀí×Ô¼ºµÄ Fork ¿ÍÕ»£¿
ÔÚ GitHub ÉÏ£¬Äã¿ÉÒÔÇáËÉÖÎÀí×Ô¼ºµÄ Fork ¿ÍÕ»£¬ÒÔÏÂÊǼ¸¸ö¼òÆӵIJÙ×÷£º
Clone Fork 씀ÓëÉÏÒ»²½Ïàͬ£¬½« Fork ÏîÄ¿ Clone µ½ÍâµØ¡£
Ìí¼ÓÉÏÓοÍÕ»ºÍͬ²½¸üÐÂ
²Î¿¼ÉÏÒ»²½ËùÐÎòµÄ²Ù×÷£¬½«ÔÓÐÏîÄ¿µÄµØµãÌí¼Óµ½×Ô¼ºµÄ Fork ÏîÄ¿ÄÚ£¬²¢Í¬²½¸üС£
Pull Request ºÏ²¢
µ±Äã Fork ÏîÄ¿µÄÄÚÈÝÓÐÖØ´óˢлòÐÞ¸´ÎÊÌâʱ£¬¿ÉÒÔÌá³ö Pull Request£¬ÇëÇóÖ÷¿ª·¢Õߺϲ¢ÄãµÄÐ޸ġ£
ͨ¹ýÒÔÉϲÙ×÷£¬Äã¿ÉÒÔÇáËÉÖÎÀí Fork ¿ÍÕ»£¬¾ÙÐÐÐ޸ġ¢ÍÆËÍ¡¢Í¬²½¸üÐÂÒÔ¼°Ìá½» Pull Request µÈ²Ù×÷¡£
Îå¡¢×ܽá
ͨ¹ý±¾ÎÄ£¬ÎÒÃÇÏêϸÕÆÎÕÁËÔõÑù Fork Ò»¸öÏîÄ¿£¬ÔõÑùͬ²½¸üРFork ÏîÄ¿£¬ÒÔ¼°ÔõÑùÖÎÀí×Ô¼ºµÄ Fork ¿ÍÕ»¡£×÷ΪһÃû Git ʹÓÃÕߣ¬³ýÁËÕÆÎÕ Fork µÄÊÖÒÕ£¬»¹Ó¦¸ÃÉîÈëÕÆÎÕ Git µÄÆäËû²Ù×÷¼¼ÇÉ£¬ÒÔ×ÊÖúÎÒÃǸüºÃµØÖÎÀíÏîÄ¿¡¢Ìá¸ßЧÂʺÍÐͬ¿ª·¢ÄÜÁ¦¡£
ÒÔÉϾÍÊÇgit ÔõÑù forkµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡