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

gitÔõôÐÞ¸Äorigin

gitÊÇÒ»¿îÂþÑÜʽ°æ±¾¿ØÖÆϵͳ £¬Ëü¿ÉÒÔ×ÊÖúÎÒÃǸßЧµØÖÎÀí´úÂë¡£ÔÚʹÓÃgitµÄÀú³ÌÖÐ £¬ÎÒÃÇ¿ÉÄÜÐèÒª¶ÔÔ¶³Ì¿ÍÕ»¾ÙÐÐһЩÐÞ¸Ä £¬ºÃ±È¸ü¸ÄÔ¶³Ì¿ÍÕ»µÄÃû³Æ»òurl¡£±¾ÎĽ«ÏÈÈÝÔõÑùͨ¹ýgitÐÞ¸Äorigin¡£

Ò»¡¢GitÖеÄorigin

ÔÚGitÖÐ £¬originÊÇĬÈϵÄÔ¶³Ì¿ÍÕ»Ãû³Æ¡£µ±ÎÒÃÇʹÓÃÒÔÏÂÏÂÁÍâµØ¿ÍÕ»ÓëÔ¶³Ì¿ÍÕ»¹ØÁªÊ± £¬Git¾Í»á×Ô¶¯Ìí¼ÓÒ»¸öÃûΪoriginµÄÔ¶³Ì¿ÍÕ»£º

git remote add origin <url></url>

µÇ¼ºó¸´ÖÆ

ÔÚÖ´ÐиÃÏÂÁîºó £¬ÎÒÃDZã¿ÉÒÔʹÓÃÒÔÏÂÏÂÁÍâµØ´úÂëÉÏ´«ÖÁ¶ÔÓ¦µÄÔ¶³Ì¿ÍÕ»£º

git push -u origin <branch></branch>

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÊöÏÂÁîÖÐ £¬¡°origin¡±Ö¸´úÔ¶³Ì¿ÍÕ»Ãû³Æ £¬¡°branch¡±Ö¸´ú·ÖÖ§Ãû³Æ¡£

¶þ¡¢ÐÞ¸ÄoriginµÄURL

ÔÚijЩÇéÐÎÏ £¬ÎÒÃÇ¿ÉÄÜÐèÒªÐÞ¸ÄÔ¶³Ì¿ÍÕ»µÄURL¡£ºÃ±È £¬µ±ÎÒÃǵÄÔ¶³Ì¿ÍÕ»ËùÔÚЧÀÍÆ÷±¬·¢ÁËת±ä £¬»òÕßÎÒÃÇÐèÒª½«Ô¶³Ì¿ÍÕ»µÄURL´ÓHTTPЭÒéÇл»ÖÁSSHЭÒéʱ £¬¾ÍÐèÒªÐÞ¸ÄÔ¶³Ì¿ÍÕ»µÄURL¡£

ÒÔÏÂÊÇÐÞ¸ÄÔ¶³Ì¿ÍÕ»URLµÄ°ì·¨£º

Ö´ÐÐÒÔÏÂÏÂÁîÉó²éÄ¿½ñÔ¶³Ì¿ÍÕ»µÄURL£º

git remote -v

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

Êä³öЧ¹ûÓ¦¸ÃÀàËÆÓÚÒÔÏÂÄÚÈÝ£º

origin  https://github.com/username/repo.git (fetch)
origin  https://github.com/username/repo.git (push)

µÇ¼ºó¸´ÖÆ

Ö´ÐÐÒÔÏÂÏÂÁîÐÞ¸ÄÔ¶³Ì¿ÍÕ»µÄURL£º

git remote set-url origin <newurl></newurl>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬¡°newURL¡±ÎªÐµÄÔ¶³Ì¿ÍÕ»URL¡£

¾ÙÀýÀ´Ëµ £¬ÈôÊÇÎÒÃÇÒª½«Ô¶³Ì¿ÍÕ»µÄURL´ÓHTTPSЭÒéÇл»ÖÁSSHЭÒé £¬¿ÉÒÔÖ´ÐÐÒÔÏÂÏÂÁ

git remote set-url origin git@github.com:username/repo.git

µÇ¼ºó¸´ÖÆ

Ö´ÐÐÍêÉÏÊöÏÂÁîºó £¬ÎÒÃÇ¿ÉÒÔÔÙ´ÎÖ´ÐÐÒÔÏÂÏÂÁîÉó²éÄ¿½ñÔ¶³Ì¿ÍÕ»µÄURL £¬È·±£ÐÞ¸ÄÒÑÉúЧ£º

git remote -v

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

Êä³öЧ¹ûÓ¦¸ÃÀàËÆÓÚÒÔÏÂÄÚÈÝ£º

origin  git@github.com:username/repo.git (fetch)
origin  git@github.com:username/repo.git (push)

µÇ¼ºó¸´ÖÆ

Èý¡¢ÐÞ¸ÄoriginµÄÃû³Æ

ÔÚijЩÇéÐÎÏ £¬ÎÒÃÇ¿ÉÄÜÐèÒªÐÞ¸ÄÔ¶³Ì¿ÍÕ»µÄÃû³Æ¡£ºÃ±È £¬µ±ÎÒÃÇÏëҪͬʱ½«´úÂëÉÏ´«ÖÁ¶à¸öÔ¶³Ì¿Íջʱ £¬¿ÉÒÔΪÿ¸ö¿ÍÕ»Ìí¼Ó²î±ðµÄÃû³Æ¡£

ÒÔÏÂÊÇÐÞ¸ÄÔ¶³Ì¿ÍÕ»Ãû³ÆµÄ°ì·¨£º

Ö´ÐÐÒÔÏÂÏÂÁîÉó²éÄ¿½ñÔ¶³Ì¿ÍÕ»µÄÃû³Æ£º

git remote

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

Êä³öЧ¹ûÓ¦¸ÃÖ»°üÀ¨Ò»¸öÃû³Æ £¬¼´¡°origin¡±¡£

Ö´ÐÐÒÔÏÂÏÂÁîÐÞ¸ÄÔ¶³Ì¿ÍÕ»µÄÃû³Æ£º

git remote rename origin <newname></newname>

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬¡°newName¡±ÎªÐµÄÔ¶³Ì¿ÍÕ»Ãû³Æ¡£

¾ÙÀýÀ´Ëµ £¬ÈôÊÇÎÒÃÇÏëÒª½«Ô¶³Ì¿ÍÕ»µÄÃû³Æ´Ó¡°origin¡±ÐÞ¸ÄΪ¡°upstream¡± £¬¿ÉÒÔÖ´ÐÐÒÔÏÂÏÂÁ

git remote rename origin upstream

µÇ¼ºó¸´ÖÆ

Ö´ÐÐÍêÉÏÊöÏÂÁîºó £¬ÎÒÃÇ¿ÉÒÔÔÙ´ÎÖ´ÐÐÒÔÏÂÏÂÁîÉó²éÄ¿½ñÔ¶³Ì¿ÍÕ»µÄÃû³Æ £¬È·±£ÐÞ¸ÄÒÑÉúЧ£º

git remote

µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ

Êä³öЧ¹ûÓ¦¸ÃÖ»°üÀ¨Ò»¸öÃû³Æ £¬¼´¡°upstream¡±¡£

×ܽá

ÔÚʹÓÃGitÖÎÀí´úÂëµÄÀú³ÌÖÐ £¬ÎÒÃÇ¿ÉÄÜÐèÒª¶ÔÔ¶³Ì¿ÍÕ»¾ÙÐÐһЩÐ޸ġ£Í¨¹ý±¾ÎÄÏÈÈݵÄÒªÁì £¬ÎÒÃÇ¿ÉÒÔÇáËɵØÐÞ¸ÄÔ¶³Ì¿ÍÕ»µÄURLºÍÃû³Æ¡£Ï£Íû±¾ÎÄÄܶÔʹÓÃGitµÄ¿ª·¢ÕßÃÇÓÐËù×ÊÖú¡£

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

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

QR code
ÍøÕ¾µØͼ