ãã®èšäºã¯ãGitããã®ä»ã®ããŒãžã§ã³ç®¡çã·ã¹ãã ãç¿ãå§ããã°ããã®ããã°ã©ããŒã«åœ¹ç«ã€ãããããŸããã çµéšè±å¯ãªããã°ã©ããŒã«ãšã£ãŠã¯ããã®èšäºã¯éåžžã«åçŽã§å¹³å¡ã«æããŸãã
ãŸãããã©ã³ããšã³ããããšã¯äœããç解ããŸãããã
ã³ããããã
ã³ãããã¯ãããŒãžã§ã³ç®¡çã·ã¹ãã ã®äž»èŠãªãªããžã§ã¯ãã§ãããšèšããŸãã ãŠãŒã¶ãŒãã¢ããªã±ãŒã·ã§ã³ã³ãŒãã«å ããå€æŽã®èª¬æãå«ãŸããŠããŸãã Gitã§ã¯ãã³ãããã¯ããã€ãã®ãããããªããžã§ã¯ãã§æ§æãããŸãã ç解ã容æã«ããããã«ãã³ãããã¯ãå€æŽããããã¡ã€ã«ãå«ããªããžã§ã¯ããšä»¥åã®ã³ããããžã®ãªã³ã¯ã§æ§æãããåäžãªã³ã¯ãªã¹ãã§ãããšæ³å®ã§ããŸãã
ã³ãããã«ã¯ä»ã®ããããã£ããããŸãã ããšãã°ãã³ãããã®æ¥ä»ãäœæè ãã³ãããã«é¢ããã³ã¡ã³ããªã©ã
ã³ã¡ã³ããšããŠãéåžžããã®ã³ããããã³ãŒãã«å ããå€æŽããŸãã¯è§£æ±ºããã¿ã¹ã¯ã®ååã瀺ããŸãã
Gitã¯åæ£ããŒãžã§ã³ç®¡çã·ã¹ãã ã§ãã ããã¯ãåãããžã§ã¯ãåå è ãããããžã§ã¯ãã®ã«ãŒãã«ããã.gitããã©ã«ãã«ãããªããžããªã®ç¬èªã®ã³ããŒãæã£ãŠããããšãæå³ããŸãã ãã¹ãŠã®ã³ããããšä»ã®Gitãªããžã§ã¯ããä¿åãããã®ã¯ãã®ãã©ã«ããŒã§ãã Gitã§äœæ¥ããå ŽåãGitã¯ãã®ãã©ã«ããŒã§ãæ©èœããŸãã
æ°ãããªããžããªã®äœæã¯éåžžã«ç°¡åã§ããããã¯ããŒã ã«ãã£ãŠè¡ãããŸã
git init
ãã®ããã«ããŠãæ°ãã空ã®ãªããžããªãååŸããŸãã æ¢åã®ãããžã§ã¯ãã®éçºã«åå ããå Žåã¯ããã®ãªããžããªããªã¢ãŒããªããžããªããããŒã«ã«ãã©ã«ãã«ã³ããŒããå¿ èŠããããŸãã ããã¯æ¬¡ã®ããã«è¡ãããŸãã
git clone <url >
ãã®åŸãçŸåšã®ãã©ã«ããŒã«.gitãã£ã¬ã¯ããªã衚瀺ããããªã¢ãŒããªããžããªã®ã³ããŒãå«ãŸããŸãã
ã³ãŒããååšããäž»ãªé åãããã€ããããŸãã
- äœæ¥ãã£ã¬ã¯ããªã¯ããããžã§ã¯ãã®ã«ãŒãã«ãããã¡ã€ã«ãã€ãŸãäœæ¥äžã®ã³ãŒãã§ãã
- ããŒã«ã«ãªããžããªã¯ã.gitããã£ã¬ã¯ããªã§ããããŸã ã ã³ãããããã®ä»ã®ãªããžã§ã¯ããä¿åããŸãã
- ãªã¢ãŒããªããžããªã¯ãå ±æãšèŠãªããããªããžããªãšåããªããžããªã§ãããããŒã«ã«ãªããžããªããã³ãããã転éããŠãä»ã®ããã°ã©ããããããèŠãããšãã§ããããã«ããŸãã è€æ°ã®ãªã¢ãŒããªããžããªãååšããå ŽåããããŸãããéåžžã¯1ã€ã§ãã
- éåžžãåé¡ãããããšãç解ããŠããå¥ã®é åããããŸãã ããã¯ãããããã¹ããŒãžã³ã°é åã§ãã å®éã«ã¯ãã³ãããã«å€æŽãå«ããåã«ããã®ã³ãããã«å«ããå 容ãæ£ç¢ºã«ã¡ã¢ããå¿ èŠããããŸãã äœæ¥ãã£ã¬ã¯ããªå ã®è€æ°ã®ãã¡ã€ã«ãå€æŽã§ããŸããããããã®ãã¹ãŠã®å€æŽãç¹å®ã®ã³ãããã«å«ããå¿ èŠã¯ãããŸããã
äžè¬ã«ãgitã®æäœã¯æ¬¡ã®ããã«ãªããŸããäœæ¥ãã£ã¬ã¯ããªå ã®ãã¡ã€ã«ãå€æŽããã³ãã³ãã䜿çšããŠãããã®å€æŽãã¹ããŒãžã³ã°é åã«è¿œå ããŸãã
git add </>
ã¢ã¹ã¿ãªã¹ã¯ä»ãã®ãã¹ã¯ã䜿çšã§ããŸãã
次ã«ãããŒã«ã«ãªããžããªã«ã³ãããããŸã
git commit âm â â
ååãªã³ããããèç©ãããŠå ±æã§ããããã«ãªã£ãããã³ãã³ããå®è¡ããŸã
git push
ãã®åŸãã³ãããã¯ãªã¢ãŒããªããžããªã«ç§»åããŸãã
ãªã¢ãŒããªããžããªããå€æŽãååŸããå¿ èŠãããå Žåã¯ãã³ãã³ããå®è¡ããå¿ èŠããããŸã
git pull
ãã®åŸãä»ã®ããã°ã©ãã«ãã£ãŠéä¿¡ãããå€æŽãããŒã«ã«ãªããžããªã«è¡šç€ºãããŸãã
ãããžã§ã¯ãã®ã¯ãŒã¯ã¹ããŒã¹å ã®ã³ãŒãã¯ãã³ãããã«å«ãŸããå€æŽãé©çšããããšã«ãã圢æãããŸãã åã³ãããã«ã¯ç¬èªã®ååããããŸããããã¯ãã³ãããèªäœã®å 容ããã®sha-1é¢æ°ã®ããã·ã¥ã®çµæã§ãã
ã³ãã³ãã䜿çšããŠã³ãããã衚瀺ã§ããŸã
git log
ãã®ã³ãã³ãã®ããã©ã«ãã®å¿ç圢åŒã¯ããŸã䟿å©ã§ã¯ãããŸããã ããã¯ãããèªã¿ããã圢åŒã§åçã衚瀺ããã³ãã³ãã§ã
git log --pretty=format:"%H [%cd]: %an - %s" --graph --date=format:%c
ãã¬ãã¥ãŒãçµäºããã«ã¯ãqããŒãæŒããŸã
次ã®ã³ãã³ãã䜿çšããŠãäœæ¥ãã£ã¬ã¯ããªãšã¹ããŒãžã³ã°é åã®å 容ã確èªã§ããŸã
git status
ã³ãã³ããå®è¡ããããšã«ãããäœæ¥ãã£ã¬ã¯ããªã以åã®ç¶æ ã«åãæ¿ããããšãã§ããŸã
git checkout <hash >
ãããè¡ãçŽåã«ãgit statusãå®è¡ããããŒã«ã«ããã³ã³ããããããŠããªãå€æŽããªãããšã確èªããŠãã ããã ããããªããšãGitã¯ãããåãæ¿ããæ¹æ³ãç解ããŸããã git statusã¯ãããŒã«ã«ã®å€æŽã§ã§ããããšãæããŠãããã®ã§ãåãæ¿ããããšãã§ããŸãã ä»ã®åãæ¿ãã¯ãŒã¯ã¹ããŒã¹ã§ã¯ããã®ã«ãŒã«ã«åŸãå¿ èŠããããŸãã
æ¯åº
Gitã®ãã©ã³ãã¯ãããããã®ã³ããããžã®ç§»åãã€ã³ã¿ãŒã§ãã éåžžããã©ã³ãã¯ã³ããããã§ãŒã³ã®æåŸã®ã³ããããæããŸãã ãã©ã³ãã¯åäžã®ã³ãããããçºçããŸãã èŠèŠçã«ã¯ããã®ããã«æ³åã§ããŸãã
ã³ãã³ããå®è¡ããŠãæ°ãããã©ã³ããäœæããŠããã«åãæ¿ããããšãã§ããŸã
git pull
git checkout âb < >
次ã®ã³ãã³ãã䜿çšããŠãåãæ¿ããã«åçŽã«ãã©ã³ããäœæã§ããŸãã
git branch < >
ãã©ã³ãã«åãæ¿ãã
git checkout < >
ãã©ã³ãã¯ãã©ã³ãããã§ã¯ãªããããªãããããã©ã³ãã«ããæåŸã®ã³ãããããçºçããããšãç解ããããšãéèŠã§ãã
éåžžããã©ã³ãã¯ç¹å¥ãªããŒãžã³ãããã§çµäºããŸããããã¯ããã©ã³ããä»ã®ãã©ã³ããšããŒãžããå¿ èŠãããããšã瀺ããŸãã ããŒãžã³ãããã«ã¯ã1ã€ã®ãã©ã³ãã«ããŒãžããã2ã€ã®ã³ããããžã®2ã€ã®ãªã³ã¯ãå«ãŸããŠããŸãã
ãã©ã³ããããŒãžããå ŽåãããŒãžã³ããããªãã§ããŒãžãçºçããå¯èœæ§ãããå¥ã®ç¶æ³ããããŸãã å®éããã©ã³ãã®1ã€ã§å€æŽãçºçããŠããªããã°ã2ã€ã®ç¥å ãšã®ããŒãžã³ãããã¯å¿ èŠãããŸããã ãã®å ŽåãGitã¯ãã©ã³ããããŒãžãããšãã«ããã®ãã©ã³ããããŒãžããããã©ã³ãã®ã³ããããããã«ããããšãåã«ã¡ã¢ããŸãã ãã®ãããªããŒãžã¹ããŒã ã¯ãæ©éãããŒãžãšåŒã°ããèŠèŠçã«ã¯æ¬¡ã®ããã«è¡šãããšãã§ããŸãã
ãããã®ãã¹ãŠã®å Žåããã©ã³ããå¥ã®ãã©ã³ããšããŒãžããåŸããã®ãã©ã³ãã§è¡ããããã¹ãŠã®ã³ãããã¯ããã©ã³ããããŒãžããããã©ã³ãã«åé¡ãããŸãã ãŸããããŒãžã¯åæ¹åã®æäœã§ã¯ãªãããšãç解ããããšãéèŠã§ãã ã¿ã¹ã¯ãã©ã³ãããã¹ã¿ãŒãã©ã³ãã«ä¿æãããšãã¿ã¹ã¯ãã©ã³ãã«ãã£ãã³ãŒãããã¹ã¿ãŒãã©ã³ãã«è¡šç€ºããããã¹ã¿ãŒãã©ã³ãããã®æ°ããã³ãŒãã¯ã¿ã¹ã¯ãã©ã³ãã«è¡šç€ºãããŸããã ãããå®çŸããã«ã¯ãmasterãã©ã³ããtaskãã©ã³ãã«ããŒãžããå¿ èŠããããŸãã
ãããã©ã³ããå¥ã®ãã©ã³ãã«ä¿æããã«ã¯ãæåã«ä¿æããããã©ã³ãã«åãæ¿ããå¿ èŠããããŸã
git checkout < >
次ã«ããã®ã¹ã¬ããã§è¡ãããææ°ã®å€æŽãååŸããŸã
git pull
次ã«ãã³ãã³ããå®è¡ããŸã
git merge < >
ããã¯ããã©ã³ãã®äœæ¥ãäžè¬çã«ã©ã®ããã«èŠãããã§ãã
æ°ãããã©ã³ããéå§ããåã«ãgit pullãå®è¡ããå¿ èŠãããããšã«æ³šæããŠãã ããã ããã«ã¯ããã€ãã®çç±ããããŸãã
- å¥ã®ããã°ã©ããŒã¯ãæ°ãããã©ã³ããéå§ããåé¡ã®è§£æ±ºã«åœ±é¿ãããããªå€æŽãè¡ããªã©ãã³ãŒããå€æŽã§ããŸãã ãããã®å€æŽã¯ãåé¡ã解決ããéã«åœ¹ç«ã¡ãŸãã
- ãããã®å€æŽã«ãããå䜵ã®ç«¶åãçºçããå¯èœæ§ããããŸãã
- ããŒãžã³ããããè¡ãããå¯èœæ§ãé«ããªããŸãã ããã¯ãåã®2ã€ã®ãã€ã³ãã»ã©æªãã¯ãããŸããã ããããäœåãªã³ããããé¿ããããšãã§ãããªãããªããããããªãã®ã§ããïŒ
人æ°ã®ããGitãã©ã³ãã¹ããŒã
ããã§ãgitã§ãã©ã³ããæäœããããã®äžè¬çãªã¹ããŒã ã説æã§ããŸãã
ããã°ã©ããŒããããžã§ã¯ãã§äžç·ã«äœæ¥ããåæã«äºãã«å¹²æžããªãããã«ããããã«ããã©ã³ããå¿ èŠã§ãã ãããžã§ã¯ããäœæãããšããGitã¯ããŒã¹ãã©ã³ããäœæããŸãã ãã¹ã¿ãŒãã©ã³ããšåŒã°ããŸãã äžå€®ãã©ã³ããã€ãŸã ã¡ã€ã³ã¢ããªã±ãŒã·ã§ã³ã³ãŒããå«ãŸããŠããŸãã
ãã©ã³ããæäœããå€å žçãªã¹ããŒã
éåžžãåé¡ã®è§£æ±ºãéå§ããåã«ãããã°ã©ããŒã¯æåŸã®äœæ¥ã³ãããããã¹ã¿ãŒãã©ã³ãããæ°ãããã©ã³ããéå§ãããã®æ°ãããã©ã³ãã®åé¡ã解決ããŸãã ãœãªã¥ãŒã·ã§ã³äžã«ã圌ã¯ããã€ãã®ã³ããããè¡ãããã®åŸãã¿ã¹ã¯ãã©ã³ãã§ã³ãŒããçŽæ¥ãã¹ãããŸãã ãããŠãã¿ã¹ã¯ã解決ããåŸãmasterãã©ã³ãã«ããŒãžãæ»ããŸãã ãã®äœæ¥ã¹ããŒã ã¯ããŠããããã¹ãããã³èªåå±éã§ãã䜿çšãããŸãã åäœãã¹ããã³ãŒãå šäœãã«ããŒããå Žåãã¿ã¹ã¯ãã©ã³ãã®ãã¹ãŠã®ãã¹ããæåã«å®è¡ãããããã«å±éãæ§æã§ããŸãã ãã®åŸãæåããå ŽåãããŒãžãšå±éãè¡ãããŸãã ãã®ã¹ããŒã ã䜿çšãããšããã¹ãããã³å±éäžã«å®å šãªèªååãå®çŸã§ããŸãã
ååä»ããã©ã³ã
çµéšã®æµ ãããã°ã©ããŒã¯ãç¬èªã®ãã©ã³ããéå§ããåžžã«ããã§äœæ¥ããŸãã äžåºŠã«1ã€ã®åé¡ã解決ããåé¡ã®1ã€ã解決ãçµãããšãWebã€ã³ã¿ãŒãã§ãŒã¹ãä»ããŠæ°ãããã«èŠæ±ãäœæããŸãïŒããã«ã€ããŠã¯ä»¥äžã§è©³ãã説æããŸãïŒã ãã®ã¢ãããŒãã®æ¬ ç¹ã¯ããã®æ¹æ³ã§ã¯1ã€ã®åé¡ã®ã¿ã解決ã§ããå¥ã®åé¡ã®è§£æ±ºã«ããã«åãæ¿ããããšãã§ããªãããšã§ãã å¥ã®æ¬ ç¹ã¯ããã©ã³ããæéã®çµéãšãšãã«ãŸããŸãåå²ããããã°ã©ããã©ã³ãã®ã³ãŒãããã¹ã¿ãŒãã©ã³ãã«é¢ããŠé ããæ©ããå»æ¢ãããæŽæ°ããå¿ èŠãããããšã§ãã ãããè¡ãã«ã¯ããã¹ã¿ãŒãã©ã³ããããã°ã©ããã©ã³ãã«ããŒãžãããããã¹ã¿ãŒãã©ã³ãã®æåŸã®äœæ¥ç¶æ ãããã®ããã°ã©ãã®æ°ãããã©ã³ããéå§ããŸãã 確ãã«ããããèµ·ããé ã«ã¯ãããã°ã©ããŒã¯æ¢ã«ãå€å žçãªãäœæ¥ã¹ããŒã ã«åãæ¿ããã®ã«ååãªgitããã¹ã¿ãŒã§ããŠããŸãã ãããã£ãŠããã®ã¹ããŒã ã¯ãGitã®çµéšã®æµ ããŠãŒã¶ãŒåãã®å Žæã§ãã
devãã©ã³ãã䜿çšããã¹ããŒã
å¥ã®ã¹ããŒã ã¯ãåŸæ¥ã®ã¹ããŒã ã«éåžžã«ãã䌌ãŠããŸããããã¹ã¿ãŒãã©ã³ãã«å ããŠããã¹ããµãŒããŒã«å±éãããéçºãã©ã³ãããããŸãã ãã®ãã©ã³ãã¯éåžždevãšåŒã°ããŸãã äœæ¥ã®ã¹ããŒã ã¯æ¬¡ã®ãšããã§ãã æ°ããã¿ã¹ã¯ãå®è¡ããåã«ãããã°ã©ãã¯ãã¹ã¿ãŒãã©ã³ãã®æåŸã®äœæ¥ç¶æ ãããã©ã³ããéå§ããŸãã 圌ã¯ã¿ã¹ã¯ã®äœæ¥ãçµãããšãã¿ã¹ã¯ãã©ã³ããèªåã§devãã©ã³ãã«ããŒãžããŸãã ãã®åŸãå ±åã§ãã¿ã¹ã¯ã¯æ®ãã®ã¿ã¹ã¯ãšå ±ã«ãã¹ããµãŒããŒã§ãã¹ããããŸãã ãšã©ãŒãããå Žåãã¿ã¹ã¯ã¯åããã©ã³ãã§ãã¡ã€ãã©ã€ãºãããdevãã©ã³ãã§ä¿æãããŸãã ã¿ã¹ã¯ã®ãã¹ããå®äºãããšããã¹ã¿ãŒãã©ã³ãã§ã¿ã¹ã¯ã®ã¿ã¹ã¯ãä¿æãããŸãã masterãã©ã³ããæäœãããã®ã¹ããŒã ã§ã¯ãdevãã©ã³ãã§ã¯ãªãtaskãã©ã³ããããŒãžããå¿ èŠãããããšã«æ³šæããããšãéèŠã§ãã å®éãdevãã©ã³ãã«ã¯ããã®ã¿ã¹ã¯ã ãã§ãªãä»ã®ã¿ã¹ã¯ã§ãè¡ãããå€æŽãå«ãŸããŸãããããã®å€æŽã®ãã¹ãŠãæ©èœãããšã¯éããŸããã ãã¹ã¿ãŒãã©ã³ããšdevãã©ã³ãã¯æéã®çµéãšãšãã«åå²ããããããã®äœæ¥ã¹ããŒã ã§ã¯ããã¹ã¿ãŒãã©ã³ãã®æåŸã®äœæ¥ç¶æ ããå®æçã«æ°ããdevãã©ã³ããéå§ãããŸãã ãã®ã¢ãããŒãã®æ¬ ç¹ã¯ãåŸæ¥ã®ã¹ããŒã ãšæ¯èŒããŠåé·æ§ã§ãã ãããžã§ã¯ãã«èªååããããã¹ãããªãããã¹ãŠã®ãã¹ããéçºãµãŒããŒã§æåã§å®è¡ãããå Žåããã®ãã©ã³ãã§ã®äœæ¥ã¹ããŒã ããã䜿çšãããŸãã
ãŸãããããã®äœæ¥ã¹ããŒã ã¯ãå¿ èŠã«å¿ããŠäºãã«çµã¿åãããããšãã§ããããšã«æ³šæããŠãã ããã
ãã«ãªã¯ãšã¹ã
ãã®æŠå¿µã«ã¯æ··ä¹±ããããŸãã å®éãGitã«ã¯ãã«ãªã¯ãšã¹ããšåŒã°ãã2ã€ã®å®å šã«ç°ãªããã®ããããŸãã ãã®1ã€ãã³ã³ãœãŒã«git pullã³ãã³ãã§ãã ãã1ã€ã¯ããªããžããªã®Webã€ã³ã¿ãŒãã§ã€ã¹ã®ãã¿ã³ã§ãã github.comã§ã¯ããã®ããã«èŠããŸã
ãã®ãã¿ã³ã«ã€ããŠã¯ããã«èª¬æããŸãã
ããã°ã©ããŒãçµéšè±å¯ã§è²¬ä»»ãããå Žåãéåžžã圌ã¯èªåã®ã³ãŒããmasterãã©ã³ãã«ããŒãžããŸãã ãã以å€ã®å Žåãããã°ã©ããŒã¯ãããããã«èŠæ±ãè¡ããŸãã ãã«ãªã¯ãšã¹ãã¯ãæ¬è³ªçã«ããŒãžãè¡ãããã®èš±å¯ãªã¯ãšã¹ãã§ãã ãã«ãªã¯ãšã¹ãã¯ãGit Webã€ã³ã¿ãŒãã§ãŒã¹ããããŸãã¯git request-pullã³ãã³ãã䜿çšããŠäœæã§ããŸãã ãã«ãªã¯ãšã¹ããäœæãããåŸãä»ã®åå è ã¯ããã確èªããããã°ã©ãããããžã§ã¯ãã«è¿œå ããããã«æäŸããã³ãŒãã衚瀺ãããã®ã³ãŒããæ¿èªãããã©ããã決å®ã§ããŸãã ãã«ãªã¯ãšã¹ãã«ããããŒãžã«ã¯é·æãšçæããããŸãã æ¬ ç¹ã¯ãçµéšè±å¯ãªããã°ã©ããŒã®ç·å¯ãªããŒã ã«ãšã£ãŠããã®ã¢ãããŒããäžèŠã«ãªãããšã§ãã ããã¯ãäœæ¥ãé ãããã ãã§ãå®å䞻矩ã®è²åããåãå ¥ããŸãã
äžæ¹ãã³ãŒããç Žãããšãã§ããçµéšè±å¯ãªããã°ã©ããŒããããžã§ã¯ãã«ããªãå Žåããã«ãªã¯ãšã¹ãã¯ãšã©ãŒãåé¿ããã®ã«åœ¹ç«ã¡ãã³ãŒãã«ã©ã®ãããªå€æŽãå ãããã芳å¯ããããšã§ããããã®ããã°ã©ããŒãè¿ éã«ãã¬ãŒãã³ã°ã§ããŸãã
ãã«ãªã¯ãšã¹ãã¯ããªãŒãã³ãœãŒã¹ããã°ã©ãã®å¹ åºãã³ãã¥ããã£ã«ãé©ããŠããŸãã ãã®å Žåããã®ãããªéçºè ã®èœåããã³ãŒãã§äœãå€æŽããããã«ã€ããŠåãã£ãŠèšãããšã¯ã§ããŸããã
察ç«
ãããã®ãã©ã³ãã§åãã³ãŒãè¡ãç°ãªãæ¹æ³ã§å€æŽãããå Žåããã©ã³ãã®ããŒãžäžã«ç«¶åãçºçããŸãã 次ã«ãGitã¯ã©ã®å€æŽãé©çšããå¿ èŠãããããGitèªèº«ã§æ±ºå®ã§ããªãããããã®ç¶æ³ãæåã§è§£æ±ºããããšãææ¡ããŠããŸãã ããã«ããããããžã§ã¯ãå ã®ã³ãŒãã§ã®äœæ¥ãé ããªããŸãã ããã¯ããŸããŸãªæ¹æ³ã§åé¿ã§ããŸãã ããšãã°ãé¢é£ããã¿ã¹ã¯ãç°ãªãããã°ã©ããŒã«ãã£ãŠåæã«å®è¡ãããªãããã«ã¿ã¹ã¯ãåæ£ã§ããŸãã
ãããåé¿ããå¥ã®æ¹æ³ã¯ãç¹å®ã®ã³ãŒãã¹ã¿ã€ã«ã«åæããããšã§ãã ãã®å Žåãããã°ã©ãã¯ã³ãŒãã®ãã©ãŒããããå€æŽãããåãè¡ãå€æŽããå¯èœæ§ãäœããªããŸãã
ããŒã ã§äœæ¥ããŠãããšãã«ç«¶åãé¿ããã®ã«åœ¹ç«ã€ãã1ã€ã®è¯ããã³ãã¯ãåé¡ã解決ãããšãã«ã³ãŒãã«æå°éã®å€æŽãå ããããšã§ãã å€æŽããè¡ãå°ãªãã»ã©ãå¥ã®ã¿ã¹ã¯ã®å¥ã®ããã°ã©ããšåãè¡ãå€æŽããå¯èœæ§ãäœããªããŸãã
å®å®ãšèŠãªãããšãã§ãããã¹ã¿ãŒãã©ã³ãã®ç¶æ ã«å°éãããšããã®ç¶æ ã®ããŒãžã§ã³ã®ã¿ã°ã§ããŒã¯ãããŸãã ããã¯ãããã°ã©ã ã®ããŒãžã§ã³ãšåŒã°ãããã®ã§ãã
ããã¯æ¬¡ã®ããã«è¡ãããŸã
git tag -a v1.0
ãã©ã³ãããªã¢ãŒããªããžããªã«è»¢éããã«ã¯ãã³ãã³ããå®è¡ããå¿ èŠããããŸã
git push âtags
ã¿ã°ã¯ãã¿ã°ã§ããŒã¯ãããã³ãŒãã®ç¶æ ã«ç°¡åã«åãæ¿ããããšãã§ãããšããç¹ã§ã䟿å©ã§ãã ããã¯åãã³ãã³ãã䜿çšããŠè¡ãããŸãã
git checkout < >
ããŸããŸãªå±éããã³èªååãããã¢ã»ã³ããªã·ã¹ãã ã¯ãã¿ã°ã䜿çšããŠãå±éãŸãã¯çµã¿ç«ãŠãå¿ èŠãããç¶æ ãèå¥ããŸãã ããã¯ãææ°ããŒãžã§ã³ã®ã³ãŒããåéãŸãã¯å±éãããšãçŸæç¹ã§ä»ã®ããã°ã©ããŒãmasterãã©ã³ãã«äœããã®å€æŽãå ãããªã¹ã¯ããããå¿ èŠãªãã®ãåéããªãããã§ãã ããã«ãäœæ¥äžã®ãããžã§ã¯ãã®ç¶æ ãšç¢ºèªæžã¿ã®ãããžã§ã¯ãã®ç¶æ ãç°¡åã«åãæ¿ããããšãã§ããŸãã
ãããã®ã«ãŒã«ãšãã©ã³ããæäœãããã¯ã©ã·ãã¯ãã¹ããŒã ãé å®ããŠããå ŽåãGitãä»ã®ã·ã¹ãã ãšçµ±åããã®ãç°¡åã«ãªããŸãã ããšãã°ãç¶ç¶çã€ã³ãã°ã¬ãŒã·ã§ã³ã·ã¹ãã ãŸãã¯packagist.orgãªã©ã®ããã±ãŒãžãªããžããªã䜿çšããŸãã éåžžããµãŒãããŒãã£ã®ãœãªã¥ãŒã·ã§ã³ãšãã¹ãŠã®çš®é¡ã®æ¡åŒµæ©èœã¯ãgitã䜿çšãããã®ãããªã¹ããŒã åãã«ç¹å¥ã«èšèšãããŠãããããã«ãã¹ãŠãæ£ããéå§ããå Žåãããã¯å°æ¥ã«ãšã£ãŠå€§ããªãã©ã¹ã«ãªãå¯èœæ§ããããŸãã
ããã¯ãGitã䜿çšããéã®ãã€ã©ã€ãã®æŠèŠã§ãã Gitã«ã€ããŠè©³ããç¥ãããå Žåã¯ãPro Gitã®æ¬ãèªãããšããå§ãããŸãã ãŸãã«ãã ã
ãã®èšäºã§ã¯ãã³ãããã®ç°¡ç¥åãããè¡šçŸã玹ä»ããŸããã ãããããããæžãåã«ãã³ãããããã£ã¹ã¯ã«ã©ã®ããã«ä¿åãããŠããããæ£ç¢ºã«ææ¡ããããšã«ããŸããã ãã®è³ªåã«ãèå³ãããå Žåã¯ã ããã§ããã«ã€ããŠèªãããšãã§ããŸã ã