ÔõÑùʹÓÃGitHub·ÖÏíÏîÄ¿
Ëæ×Å»¥ÁªÍøµÄÉú³¤£¬¿ªÔ´ÉçÇøµÄ»îÔ¾£¬Ô½À´Ô½¶àµÄÈ˺ÍÍŶÓʹÓÃgithubÕâһƽ̨À´·ÖÏíºÍÖÎÀíËûÃǵÄÏîÄ¿¡£githubÊÇÒ»¸öÐ×÷ÐÔ×ӵĴúÂëÍйÜƽ̨£¬Ëü²»µ«ÄÜΪ¿ª·¢ÕßÌṩһ¸ö½»Á÷ºÍѧϰµÄƽ̨£¬Í¬Ê±»¹ÄÜʹ¿ª·¢Õ߸ü¸ßЧµØÐ×÷Íê³ÉÏîÄ¿¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃgithub·ÖÏíÏîÄ¿¡£
Ò»¡¢×¢²áGitHubÕË»§
Ê×ÏÈÐèҪע²áÒ»¸öGitHubÕË»§£¬»á¼ûGitHubÍøÕ¾£¬µã»÷¡°Sign up¡±°´Å¥×îÏÈ×¢²áÕ˺š£È»ºóƾ֤ÌáÐÑÊäÈëÄãµÄÓû§Ãû¡¢µç×ÓÓÊÏäµØµãºÍÃÜÂ룬Ìá½»Àֳɺóͨ¹ýÓÊÏä»òÄã×¢²áµÄÊÖ»úºÅÂë¾ÙÐÐÑéÖ¤Éí·Ý¡£
¶þ¡¢ÉÏ´«ÏîÄ¿
ÈôÊÇÄãÏëÒª·ÖÏí×Ô¼ºµÄÏîÄ¿£¬Ê×ÏÈÐèÒªÔÚGitHubÉϽ¨ÉèÒ»¸öеĿÍÕ»£¨Repository£©¡£ÔÚ´Ë֮ǰ£¬ÄãÐèÒªÏàʶһЩÓë¿ÍÕ»Ïà¹ØµÄÊõÓ
¿ÍÕ»Ãû£¨Repository name£©: ¿ÍÕ»µÄÃû³ÆÊÇ¿ÉÒÔ×Ô½ç˵µÄ£¬Í¨³£ÊÇÓÃÀ´ÐÎòÄãÕýÔÚÐû²¼µÄÏîÄ¿µÄÃû³Æ¡£
ÐÎò£¨Description£©: ÕâÊǶÔÄãµÄÏîÄ¿¼ò¶ÌµÄÐÎò¡£
READMEÎļþ£ºÕâÊÇÄãµÄÏîÄ¿µÄÏêϸÏÈÈÝ£¬Äã¿ÉÒÔÔÚÕâÀïÌí¼ÓһЩͼƬ»òÕß³¬Á´½Ó¡£
.gitignoreÎļþ£ºÔÚÕâ¸öÎļþÖУ¬Äã¿ÉÒÔÉèÖÃÄÄЩÎļþ»òÎļþ¼Ð¿ÉÒÔ±»GitºöÂÔ£¨²»ÉÏ´«ÖÁGitHub£©¡£
½¨Éè¿ÍÕ»µÄ°ì·¨ÈçÏ£º
µã»÷Ö÷Ò³ÃæµÄ¡°New repository¡±°´Å¥¡£
ÔÚµ¯³öÀ´µÄÒ³ÃæÖÐÌîдÏà¹ØÐÅÏ¢£¬°üÀ¨¿ÍÕ»Ãû¡¢ÐÎò¡¢READMEÎļþºÍ.gitignoreÎļþµÈ¡£
µã»÷¡°Create repository¡±°´Å¥¼´¿É¡£
½ÓÏÂÀ´£¬ÔÚÄãµÄÍâµØµçÄÔÉÏʹÓÃGitÏÂÁÄãµÄÏîÄ¿ÉÏ´«ÖÁGitHubÉÏ£¬Ïêϸ°ì·¨ÈçÏ£º
·¿ªÖն˴°¿Ú£¨ÈçWindowsϵÄcmd´°¿Ú£©£¬½øÈëÄãµÄÏîĿĿ¼£¬ÀýÈ磺
cd /your/path/to/project
µÇ¼ºó¸´ÖÆ
³õʼ»¯ÄãµÄÍâµØ¿ÍÕ»£º
git init
µÇ¼ºó¸´ÖÆ
Ìí¼ÓËùÓÐÎļþ£º
git add .
µÇ¼ºó¸´ÖÆ
ÈôÊÇÒªÌí¼Óij¸öÌض¨µÄÎļþ£¬¾ÍÐèÒªÊäÈë¸ÃÎļþµÄÃû³Æ¡£
Ìá½»µ½ÍâµØ¿ÍÕ»£º
git commit -m "ÏîÄ¿ÐÎòÐÅÏ¢"
µÇ¼ºó¸´ÖÆ
½«ÍâµØ¿ÍÕ»ÓëÔ¶³Ì¿ÍÕ»¹ØÁª£¨½«ÍâµØ¿ÍÕ»µÄ´úÂëÉÏ´«µ½ÄãÔÚGitHubÉϽ¨ÉèµÄ¿ÍÕ»ÖУ©£º
git remote add origin https://github.com/yourusername/your-repository-name.git
µÇ¼ºó¸´ÖÆ
yourusernameÊÇÄãÔÚGitHubÉϵÄÕË»§Ãû£¬your-repository-nameÊÇÄãËù½¨ÉèµÄ¿ÍÕ»Ãû¡£
½«ÍâµØµÄ´úÂëÉÏ´«µ½GitHubÉÏ£º
git push -u origin master
µÇ¼ºó¸´ÖÆ
´Ëʱ£¬ÄãµÄÏîÄ¿ÒѾÉÏ´«ÖÁGitHubÉÏ£¬ÆäËûÓû§±ã¿ÉÒÔ´ÓÄãµÄGitHubÉÏÏÂÔØÄãµÄÏîÄ¿¡£
Èý¡¢ÓëËûÈËÐ×÷
GitHub¿ÉÒÔ×ÊÖú¿ª·¢ÕßÐ×÷Íê³ÉÏîÄ¿£¬Ïêϸ°ì·¨ÈçÏ£º
Ô¼ÇëÏàÖúÕߣº
µÇ¼GitHubÕË»§£¬ÕÒµ½ÄãÏëÒªÔ¼ÇëµÄÏàÖúÕßµÄÕË»§£¬ÔÚ¸ÃÕË»§µÄÖ÷Ò³ÉÏÑ¡Ôñ¡°Fork¡±°´Å¥£¬½«¸ÃÏîÄ¿ÅÉÉúµ½Ëû×Ô¼ºµÄGitHubÕË»§ÖУ¬È»ºó¿Ë¡¸ÃÏîÄ¿²¢¾ÙÐÐÐ޸ģ¬¿ÉÒÔͨ¹ýPull Request·½·¨ÓëÄãµÄÖ÷ÏîÄ¿¾ÙÐкϲ¢¡£
½¨Éèissue£º
ÏîÄ¿ÔÚ¿ª·¢Àú³ÌÖÐÄÑÃâ»áÓöµ½Ò»Ð©ÎÊÌâ»ò bug£¬Äã¿ÉÒÔÔÚ GitHubµÄÍøÒ³ÉϸøÏîÄ¿½¨ÉèÒ»¸ö issue£¬À´·´ÏìÕâ¸öÎÊÌâ»ò bug£¬ÆäËûÏàÖúÕßÃÇ¿ÉÒÔÔÚ issueÖоÙÐÐÌÖÂÛÏ¢Õù¾öÎÊÌâ¡£
·Ö֧ʽ¿ª·¢£º
ÔÚGitHubÖУ¬Ã¿¸öÏàÖúÕß¿ÉÒÔ×ÔÁ¦µØÊÂÇ飬ÔËÓ÷ÖÖ§£¨Branch£©µÄ·½·¨À´¾ÙÐÐÐ×÷¿ª·¢¡£¼´Ã¿¸ö¿ª·¢Õß¿ÉÒÔ½«Ö÷·ÖÖ§¿Ë¡µ½×Ô¼ºµÄ·ÖÖ§ÉÏ£¬È»ºóÔÚ×Ô¼ºµÄ·ÖÖ§ÉÏÐ޸ĴúÂ룬ÐÞ¸ÄÍê³ÉºóÔÙÍÆË͵½Ö÷·ÖÖ§ÉϾÙÐкϲ¢¡£
ËÄ¡¢×ܽá
±¾ÎÄÏÈÈÝÁËÔõÑùʹÓÃGitHub·ÖÏíÏîÄ¿£¬Ïêϸ°ì·¨°üÀ¨×¢²áÕË»§¡¢ÉÏ´«ÏîÄ¿¡¢ÓëËûÈËÐ×÷µÈ¡£Í¨¹ýʹÓÃGitHub¾ÙÐÐÏîÄ¿ÖÎÀíºÍÐ×÷£¬Äã¿ÉÒÔ¸üÀû±ãµØ¿ª·¢ºÍ·ÖÏíÄãµÄ´úÂ룬¼ÓËÙÏîÄ¿µü´ú£¬Ìá¸ßÐͬ¿ª·¢µÄЧÂÊ¡£
ÒÔÉϾÍÊÇÔõÑùʹÓÃGitHub·ÖÏíÏîÄ¿µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡