×ðÁú¿­Ê±¹ÙÍøµÇ¼

ÔõÑùÔÚGitÉÏÐÞ¸Äorigin

gitÊÇ¿ªÔ´µÄÂþÑÜʽ°æ±¾¿ØÖÆϵͳ £¬³£±»ÓÃÓÚЭͬ¿ª·¢´úÂë¡£ÔÚʹÓÃgitʱ £¬¾­³£ÐèÒªÐÞ¸ÄgitµÄorigin £¬±¾ÎĽ«Îª¸÷ÈËÏêϸÏÈÈÝÔõÑùÔÚgitÉÏÐÞ¸Äorigin¡£

Ê×ÏÈ £¬ÎÒÃÇÐèÒªÏàʶʲôÊÇorigin¡£ÔÚGitÖÐ £¬originÊÇÒ»¸öÖ¸ÏòÔ¶³Ì¿ÍÕ»µÄÖ¸Õë £¬ËüĬÈÏÖ¸ÏòÎÒÃÇ¿Ë¡»òÀ­È¡´úÂëµÄÔ´¿ÍÕ»¡£ÎÒÃÇͨ³£ÐèÒªÔÚ¾ÙÐдúÂëÉÏ´«Ê±ÓëÔ¶³Ì¿ÍÕ»¾ÙÐÐͨѶ £¬ÒÔ±ã°Ñ´úÂëºÏ²¢¡£Òò´Ë £¬¸ü¸ÄoriginÖ¸ÏòµÄÔ¶³Ì¿ÍÕ» £¬ÊǺÜÊÇÖ÷ÒªµÄ¡£

ÄÇô £¬ÔõÑùÐÞ¸ÄoriginÄØ £¿ÏÂÃæÎÒÃǽ«ÏÈÈÝÁ½ÖÖÐÞ¸ÄoriginµÄÒªÁì¡£

ÒªÁìÒ»£ºÊ¹ÓÃGitÏÂÁîÐÞ¸Äorigin

ÔÚʹÓÃGitʱ £¬Í¨³£ÎÒÃÇÐèҪͨ¹ýÏÂÁîÐеķ½·¨¾ÙÐвÙ×÷¡£ÈôÊÇÐèÒªÐÞ¸Äorigin £¬ÎÒÃÇ¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁî¾ÙÐУº

$ git remote set-url origin <new-url></new-url>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ ÊÇеĿÍÕ»µØµã¡£ÎÒÃÇ¿ÉÒÔͨ¹ýÕâ¸öÏÂÁî £¬½«originÖ¸ÏòÒ»¸öеÄÔ¶³Ì¿ÍÕ»µØµã¡£

ÀýÈç £¬ÎÒÃÇÐèÒª½«Git¿ÍÕ»Ö¸Ïòhttps://github.com/my-name/my-repo.git £¬ÎÒÃÇ¿ÉÒÔÔÚÏÂÁîÐÐÖÐÊäÈëÒÔÏÂÏÂÁ

$ git remote set-url origin https://github.com/my-name/my-repo.git

µÇ¼ºó¸´ÖÆ

ÕâÑù £¬Git¿ÍÕ»µÄorigin¾ÍÖ¸ÏòÁËÎÒÃÇеÄÔ¶³Ì¿ÍÕ»µØµã¡£

ÒªÁì¶þ£ºÐÞ¸ÄgitÉèÖÃÎļþ

ÁíÍâÒ»ÖÖÒªÁìÊÇÖ±½ÓÐÞ¸ÄgitµÄÉèÖÃÎļþ¡£ÎÒÃÇ¿ÉÒÔͨ¹ýÐÞ¸ÄÉèÖÃÎļþµÄ·½·¨ £¬ÐÞ¸ÄGitµÄoriginÖ¸Ïò¡£

ÎÒÃǵÄGitÉèÖÃÎļþͨ³£ÊÇÔÚ ~/.gitconfig Ï嵀 £¬ÒÔÏÂÊÇÐÞ¸ÄÉèÖÃÎļþµÄÒªÁ죺

ÔÚÏÂÁî´°¿ÚÖз­¿ªÉèÖÃÎļþ

$ open ~/.gitconfig

µÇ¼ºó¸´ÖÆ

ÕÒµ½ÉèÖÃÎļþÖÐµÄ [remote “origin”] ²¢ÐÞ¸Ä url ²ÎÊýΪеĿÍÕ»µØµã

[remote "origin"]
url = https://github.com/my-name/my-repo.git

µÇ¼ºó¸´ÖÆ

ÉúÑÄÎļþ²¢Í˳ö

ÔÚÏÂÁîÐÐÖÐÔËÐÐ $ git fetch »ò $ git pull ÒÔ±ãʹ¸ü¸ÄÉúЧ

ÐèҪעÖصÄÊÇ £¬ÕâÖÖÐÞ¸ÄÒªÌå»áÓ°ÏìÕû¸öGitÇéÐÎ £¬¶ø²»µ«½öÊÇÄ¿½ñµÄGit¿ÍÕ»¡£

×ܽá

ÔÚGitÖÐÐÞ¸ÄoriginÊǺÜÊǼòÆӵġ£ÎÒÃÇ¿ÉÒÔͨ¹ýGitÏÂÁî»òÕßÐÞ¸ÄgitÉèÖÃÎļþµÄÒªÁì £¬À´Ö¸¶¨GitµÄoriginÖ¸Ïò¡£ÔÚÏÖʵʹÓÃÖÐ £¬Ó¦¸Ãƾ֤ÏêϸÇéÐÎÑ¡Ôñ×îÊʺϵÄÒªÁì¾ÙÐвÙ×÷¡£

×îºó £¬ÎÒÃÇÐèҪǿµ÷µÄÊÇ £¬ÔÚ¸ü¸ÄÔ¶³Ì¿ÍÕ»µØµã֮ǰ £¬Ò»¶¨ÒªË¼Á¿ºÃËùÓеÄΣº¦ºÍDZÔÚµÄÎÊÌâ¡£ÕâÑù²Å»ªÈ·±£ÎÒÃǵĴúÂëÇå¾²¿É¿¿ £¬×èÖ¹±¬·¢²»ÐëÒªµÄƶÀ§¡£

ÒÔÉϾÍÊÇÔõÑùÔÚGitÉÏÐÞ¸ÄoriginµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

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

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

QR code
ÍøÕ¾µØͼ