githubÖÐÔõôÉÏ´«×Ô¼ºµÄ´úÂë
ÔÚÊý×Ö»¯µÄ½ñÌ죬³ÌÐòÔ±ÃǹØÓÚ´úÂëµÄÖÎÀí²»¿Éν²»Ö÷Òª¡£ÔÚ´úÂëÖÎÀí¹¤¾ßÖУ¬×îÊ¢ÐеÄĪ¹ýÓÚgithubÁË¡£ÄÇô£¬µ±ÄãÓÐÐèÒªÔÚgithubÉÏÉÏ´«×Ô¼ºµÄ´úÂëʱ£¬¸ÃÔõô×öÄØ£¿ÏÂÃ棬±¾ÎĽ«ÎªÄãÏêϸÏÈÈÝÔõÑùÔÚgithubÉÏÉÏ´«×Ô¼ºµÄ´úÂë¡£
µÚÒ»²½£º½¨Éè¿ÍÕ»
ÔÚÉÏ´«´úÂë֮ǰ£¬ÄãÐèÒªÔÚgithubÉϽ¨ÉèÒ»¸ö¿ÍÕ»¡£Ê×ÏÈ£¬µÇ¼ÄãµÄgithubÕË»§£¬È»ºóµã»÷ÓÒÉϽǵġ°+¡±ºÅ£¬Ñ¡Ôñ¡°New Repository¡±¡£
ÔÚÐÂÒ³ÃæÖУ¬ÄãÐèҪΪÄãµÄ¿ÍÕ»ÃüÃû£¬ÌîдһЩÐÎòÐÅÏ¢²¢Ñ¡ÔñÊǽ«´úÂ뽨ÉèΪ¹«¹²¿ÍÕ»£¨Public£©ÕÕ¾É˽ÓпÍÕ»£¨Private£©¡£ÈôÊÇÄúÏ£ÍûÓëËûÈËÐ×÷£¬ÔòÑ¡Ôñ¹«¹²¿ÍÕ»£¬²»È»Ñ¡Ôñ˽ÓпÍÕ»¡£Ö®ºó£¬µã»÷¡°Create Repository¡±¼´¿É½¨ÉèÒ»¸öеĿÍÕ»¡£
µÚ¶þ²½£ºÍâµØ´úÂëÐÞ¸Ä
ÔÚÉÏ´«µ½github֮ǰ£¬ÄãÐèÒªÒÔgitÏÂÁîÍâµØ½¨ÉèÒ»¸ö´úÂë¿ÍÕ»£¬²¢¾ÙÐÐÐ޸ġ£ÏÂÃ潫½¨ÒéÄúÔÚÖÕ¶ËÖÐÖ´ÐÐÒÔÏÂÏÂÁ
cd /path/to/code
// ½øÈëÒªÉÏ´«µÄ´úÂëËùÔÚĿ¼
git init
// ³õʼ»¯´úÂë¿ÍÕ»
git add .
// Ìí¼Ó´úÂëµ½ÍâµØ¿ÍÕ»
git commit -m ‘commit message’
// Ìá½»½ÓÂëÖÁÍâµØ¿ÍÕ»
µÚÈý²½£ºÉÏ´«µ½github
½«ÐÞ¸ÄÍêµÄ´úÂëÉÏ´«µ½githubÖС£ÎÒÃÇÀ´ÏàʶÔõÑùÖ´ÐиÃʹÃü£º
½«ÍâµØ´úÂëÓëÔ¶³Ì¿ÍÕ»¹ØÁª£º
git remote add origin [Ô¶³Ì¿ÍÕ»µÄgitµØµã]
// ÈôÊÇÄãÒѾ½«´úÂëÉÏ´«µ½ÆäËûµÄgit¹¤¾ßÖУ¬ÇëʹÓýÏÌØÊâµÄÏÂÁgit remote set-url origin [Ô¶³Ì¿ÍÕ»µØµã]
½«ÍâµØ´úÂëÉÏ´«µ½github£º
git push origin master£¨ÆäÖУ¬master ΪÄãËùÔÚµÄÍâµØ·ÖÖ§£©
ÖÁ´Ë£¬ÄãµÄ´úÂëÒÑÀÖ³ÉÉÏ´«ÖÁgithubÖС£
µÚËIJ½£ºÈñðÈË¿´µ½ÄãµÄ´úÂë
ÈôÊÇÄãÏë¹Ø×¢´úÂë¿âÇëÈñðÈËÓÐʱ»úÔµ¼ûºÍ¹Ø×¢ÄãµÄ´úÂ룬ÄÇôÄãÐèÒª¾ÙÐÐһЩÌØÊâµÄ²Ù×÷£º
ÔÚgithubÉÏÇл»µ½ÄãµÄ´úÂë¿â£¬µã»÷¡°Settings¡±°´Å¥¡£
µã»÷¡°Collaborators¡±Ñ¡Ïî¡£
ËÑË÷ÄãÏëÒªÓëÖ®·ÖÏíµÄÓû§Ãû³Æ£¬È»ºóµã»÷¡°Add collaborator¡±°´Å¥¡£
ÁíÍ⣬Äã¿ÉÒÔÔÚ¡°Settings¡±²Ëµ¥ÖнøÈë¡°Manage Access¡±À´ÖÎÀíÄãµÄ´úÂë¿âµÄÓû§»á¼ûȨÏÞ¡£±ðµÄ£¬Ä㻹¿ÉÒÔÔ¼ÇëÆäËûÈ˼ÓÈëµ½ÄãµÄ×éÖ¯ÖÐÀ´¾ÙÐÐÍêÕûµÄÐͬ¿ª·¢ÊÂÇé¡£
×ܽá
ÔÚgithubÉÏÉÏ´«×Ô¼ºµÄ´úÂ룬ÊdzÌÐòÔ±ÃDZØÐèÍê³ÉµÄʹÃüÖ®Ò»¡£Í¨¹ýÒÔÉÏ°ì·¨£¬ÄãÒѾÀֳɵؽ«×Ô¼ºµÄ´úÂëÉÏ´«µ½ÁËgithubÉÏ£¬Ï£ÍûÕâƪÎÄÕÂÄܹ»¶ÔÄãÓÐËù×ÊÖú¡£ÔÚ¿ª·¢Àú³ÌÖУ¬ÎÒÃÇ»¹¿ÉÒÔʹÓÃGithubʵÏÖ°æ±¾¿ØÖÆ¡¢¶¯Ì¬¼Í¼ºÍ×·ËÝת±äÄÚÈݵÈÐí¶àÇ¿Ê¢µÄ²Ù×÷¡£ÎªÁ˸üºÃµÄÐ×÷¿ª·¢ºÍÌá¸ßÊÂÇéЧÂÊ£¬ÎÒÃǽ¨ÒéÄúÊìϤÏà¹Ø²Ù×÷ºÍ¹æ·¶¡£
ÒÔÉϾÍÊÇgithubÖÐÔõôÉÏ´«×Ô¼ºµÄ´úÂëµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡