dzÎöʹÓÃGithubµÄ»ù±¾²Ù×÷Á÷³Ì
ÔÚʹÓà github µÄʱ¼ä£¬ÐèÒªÏÈ×°Öà git ¹¤¾ß£¬ÔÙÉèÖà github ÕË»§£¬È»ºó²Å»ªÉÏ´«´úÂëµ½ github ÉÏÃæ¡£ÏÂÃæ¾ÍÊÇÏêϸµÄ²Ù×÷°ì·¨£º
×°Öà Git ¹¤¾ß
Ê×ÏÈÐèÒªÔÚÅÌËã»úÉÏ×°Öà Git ¹¤¾ß¡£ÔÚ Windows ²Ù×÷ϵͳÉÏ£¬¿ÉÒÔÉÏ Git ¹ÙÍøÏÂÔØ×°ÖóÌÐò£»ÔÚ Linux »òÕß macOS ÉÏ£¬¿ÉÒÔʹÓÃϵͳ×Ô´øµÄ°ü¹ÜÀíÆ÷×°Öà Git¡£
½¨Éè Github ÕË»§
ÈôÊÇ»¹Ã»ÓÐ Github ÕË»§£¬ÐèÒªÏÈ×¢²áÒ»¸öÕË»§¡£ÔÚ×¢²áÀú³ÌÖÐÐèÒªÌîдÓû§Ãû¡¢µç×ÓÓʼþµØµãºÍÃÜÂëµÈÐÅÏ¢¡£
½¨ÉèÐÂÏîÄ¿
ÔÚ Github ½çÃæÉÏ£¬µã»÷ “New repository” °´Å¥½¨ÉèÒ»¸öеÄÏîÄ¿¡£
¿Ë¡ÏîÄ¿
ÔÚÍâµØÅÌËã»úÉÏ£¬Ê¹Óà Git ¹¤¾ßͨ¹ýÏÂÁîÐпË¡ Github ÉϵÄÏîÄ¿´úÂëµ½ÍâµØ¡£
$ git clone git@github.com:username/projectname.git
ÆäÖУ¬username ÊÇ Github ÕË»§Ãû£¬projectname ÊÇÏîÄ¿Ãû³Æ¡£
Ð޸ĴúÂë
ÔÚÍâµØµçÄÔÉÏÐÞ¸ÄÏîÄ¿´úÂ룬¿ÉÒÔʹÓÃÈκÎÎı¾±à¼Æ÷»òÕß¼¯³É¿ª·¢ÇéÐΣ¨IDE£©¡£ÔÚÐ޸ĴúÂë֮ǰ£¬ÐèÒªÏÈ´Ó Github ÉϽ«´úÂëÀÈ¡µ½ÍâµØ¡£
$ git pull origin master
Ìá½»¸ü¸Ä
ÔÚÍê³É´úÂëµÄÐÞ¸ÄÖ®ºó£¬ÐèÒª½«ÐÞ¸ÄÌá½»µ½ Github ÉÏ¡£
$ git add .
$ git commit -m “add new feature”
$ git push origin master
ÆäÖÐ “add new feature” ÊǶԴúÂëÐ޸ĵÄ×¢ÊÍ¡£
ºÏ²¢´úÂë
ÈôÊǶàСÎÒ˽ÈËÒ»ÆðÐ×÷¿ª·¢Ò»¸öÏîĿʱ£¬ÐèÒªºÏ²¢´úÂë¡£ºÏ²¢Ö®Ç°ÐèÒªÏÈÀÈ¡×îеĴúÂë¡£
$ git pull origin master
È»ºóÔÙÌá½»½ÓÂë¡£
Ìá½» Pull Request
µ±Ò»Ð¡ÎÒ˽ÈËÐÞ¸ÄÁËÏîÄ¿´úÂëÖ®ºó£¬ÐèÒªÌá½» Pull Request ½«´úÂëºÏ²¢µ½Ô¶³Ì¿ÍÕ»£¨Github£©µÄ master ·ÖÖ§ÉÏ¡£Õâʱ£¬ÆäËûÐ×÷Õß¿ÉÒÔ¶ÔÕâ¸ö Pull Request ¾ÙÐÐ̸ÂÛ¡¢Éó²é´úÂëµÈ²Ù×÷£¬×îÖÕÔٺϲ¢µ½ master ·ÖÖ§¡£
ÒÔÉϾÍÊÇʹÓà Github µÄ»ù±¾²Ù×÷Á÷³Ì£¬ÐÅÍжÁÕßÔÚÃ÷È·ÁËÕâЩÄÚÈÝÖ®ºó£¬¿ÉÒÔÇáËÉÉÏÊÖ Github µÄʹÓá£
ÒÔÉϾÍÊÇdzÎöʹÓÃGithubµÄ»ù±¾²Ù×÷Á÷³ÌµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡