-
6. GitHub
-
7. Git ã®ããŸããŸãªããŒã«
- 7.1 ãªããžã§ã³ã®éžæ
- 7.2 察話çãªã¹ããŒãžã³ã°
- 7.3 äœæ¥ã®é ããããšæ¶ããã
- 7.4 äœæ¥å 容ãžã®çœ²å
- 7.5 æ€çŽ¢
- 7.6 æŽå²ã®æžãæã
- 7.7 ãªã»ããã³ãã³ã詳説
- 7.8 é«åºŠãªããŒãžææ³
- 7.9 Rerere
- 7.10 Git ã«ãããããã°
- 7.11 ãµãã¢ãžã¥ãŒã«
- 7.12 ãã³ãã«ãã¡ã€ã«ã®äœæ
- 7.13 Git ãªããžã§ã¯ãã®çœ®ãæã
- 7.14 èªèšŒæ å ±ã®ä¿å
- 7.15 ãŸãšã
-
8. Git ã®ã«ã¹ã¿ãã€ãº
- 8.1 Git ã®èšå®
- 8.2 Git ã®å±æ§
- 8.3 Git ããã¯
- 8.4 Git ããªã·ãŒã®å®æœäŸ
- 8.5 ãŸãšã
-
9. Gitãšãã®ä»ã®ã·ã¹ãã ã®é£æº
-
10. Gitã®å åŽ
- 10.1 é 管ïŒPlumbingïŒãšç£åšïŒPorcelainïŒ
- 10.2 Gitãªããžã§ã¯ã
- 10.3 Gitã®åç §
- 10.4 Packfile
- 10.5 Refspec
- 10.6 転éãããã³ã«
- 10.7 ã¡ã³ããã³ã¹ãšããŒã¿ãªã«ããª
- 10.8 ç°å¢å€æ°
- 10.9 ãŸãšã
-
A1. ä»é² A: ãã®ä»ã®ç°å¢ã§ã®Git
- A1.1 ã°ã©ãã£ã«ã«ã€ã³ã¿ãã§ãŒã¹
- A1.2 Visual Studioã§Gitã䜿ã
- A1.3 Eclipseã§Gitã䜿ã
- A1.4 Bashã§Gitã䜿ã
- A1.5 Zshã§Gitã䜿ã
- A1.6 Powershellã§Gitã䜿ã
- A1.7 ãŸãšã
-
A2. ä»é² B: Gitãããªãã®ã¢ããªã±ãŒã·ã§ã³ã«çµã¿èŸŒã
-
A3. ä»é² C: Gitã®ã³ãã³ã
- A3.1 ã»ããã¢ãããšèšå®
- A3.2 ãããžã§ã¯ãã®ååŸãšäœæ
- A3.3 åºæ¬çãªã¹ãããã·ã§ãã
- A3.4 ãã©ã³ããšããŒãž
- A3.5 ãããžã§ã¯ãã®å ±æãšã¢ããããŒã
- A3.6 æ€æ»ãšæ¯èŒ
- A3.7 ãããã°
- A3.8 ãããã®é©çš
- A3.9 ã¡ãŒã«
- A3.10 å€éšã·ã¹ãã
- A3.11 ã·ã¹ãã 管ç
- A3.12 é 管ã³ãã³ã
4.8 GitãµãŒã㌠- GitLab
GitLab
åç¯ã§çŽ¹ä»ãã GitWeb ã¯ãšãŠãã·ã³ãã«ã§ããã ããããã£ãšã¢ãã³ã§é«æ©èœãª Git ãµãŒããŒãå¿ èŠãªå Žåã«ã¯ãä»ã®ãªãŒãã³ãœãŒã¹ã»ãœãããŠã§ã¢ãéžæè¢ã«ãªãã§ãããã ãããã®ãªãã§ã GitLab ã¯ãã䜿ãããŠããŸãã®ã§ãäžäŸãšããŠçŽ¹ä»ããŸãã GitWeb ãããè€éã§ã¡ã³ããã³ã¹ãå¿ èŠã§ã¯ãããŸãããGitLab ã¯ããé«æ©èœãªéžæè¢ã§ãã
ã€ã³ã¹ããŒã«
GitLab ã¯ããŒã¿ããŒã¹ã䜿çšãã Web ã¢ããªã±ãŒã·ã§ã³ã§ãããã®ãããã€ã³ã¹ããŒã«æ¹æ³ã¯ä»ã® Git ãµãŒããŒããè€éã«ãªã£ãŠããŸããŸãã ãšã¯ããã幞ããªããšã«ããã¥ã¡ã³ãã¯å å®ããŠããŠããã€æé ã¯ç°¡çŽ åãããŠããŸãã
GitLab ã¯æ°çš®é¡ã®æ¹æ³ã§ã€ã³ã¹ããŒã«ã§ããŸãã ãšããããåãããŠã¿ãã«ã¯ãä»®æ³ãã·ã³ã®ã€ã¡ãŒãžããããã¯ã¯ã³ã¯ãªãã¯ã€ã³ã¹ããŒã©ãŒã䜿ããŸãã https://bitnami.com/stack/gitlab ãããããã®ãã¡ã€ã«ãããŠã³ããŒãã»ã€ã³ã¹ããŒã«ãã䜿çšããç°å¢ã«å¿ããŠèšå®ãå€æŽããŸãããã ãã®æ¹æ³ã§ã¯ãBitnami ãæ°ãå©ãããŠãã°ã€ã³ç»é¢ã䜿ããããã«ããŠãããŠããŸãïŒalt-â ãšå ¥åãããšè¡šç€ºãããŸãïŒãã€ã³ã¹ããŒã«ãã GitLab çšã® IP ã¢ãã¬ã¹ã»ãŠãŒã¶ãŒåã»ãã¹ã¯ãŒãã衚瀺ããŠããã䟿å©ãªç»é¢ã§ãã
ãã®ä»ã®æ¹æ³ã«ã€ããŠã¯ãGitLab Community Edition ã® README ãåç §ããŠãã ããã https://gitlab.com/gitlab-org/gitlab-ce/tree/master ã§ç¢ºèªã§ããŸãã ããã§çŽ¹ä»ãããŠãã GitLab ã®ã€ã³ã¹ããŒã«æ¹æ³ã«ã¯ãChef ã®ã¬ã·ãã䜿ãæ¹æ³ãDigital Ocean ã§ä»®æ³ãã·ã³ãçšããæ¹æ³ãRPM ã DEB ã®ããã±ãŒãžãçšããæ¹æ³ïŒå·ç段éã§ã¯ããŒã¿ïŒãªã©ããããŸãã ãã®ä»ã«ã âéå ¬åŒâ ã®ã¬ã€ããšããŠããµããŒãå€ã® OS ãããŒã¿ããŒã¹ã§ GitLab ãåããæ¹æ³ãæåã§ã€ã³ã¹ããŒã«ãè¡ãããã®ã¹ã¯ãªãããªã©ãå€ãã®ãããã¯ã玹ä»ãããŠããŸãã
GitLab ã®ç®¡ç
GitLab ã®ç®¡çç»é¢ã¯ãã©ãŠã¶ã§ã¢ã¯ã»ã¹ããŸãã
ãã©ãŠã¶ã䜿ã£ãŠ GitLab ãã€ã³ã¹ããŒã«ãããµãŒããŒã®ãã¹ãåã IP ã¢ãã¬ã¹ã«ã¢ã¯ã»ã¹ãã管çè
ãšããŠãã°ã€ã³ããŸãããã
ããã©ã«ãã®ãŠãŒã¶ãŒå㯠admin@local.host
ã§ãããã©ã«ãã®ãã¹ã¯ãŒã㯠5iveL!fe
ã§ãïŒãã®çµã¿åããã§ãã°ã€ã³ãããšããã¹ã¯ãŒããå€æŽããããšãæåã«ä¿ãããŸãïŒã
ãã°ã€ã³ãããã ç»é¢å³äžã®ã¡ãã¥ãŒã«ãã âAdmin areaâ ã®ã¢ã€ã³ã³ãã¯ãªãã¯ããŸãããã
ãŠãŒã¶ãŒ
GitLab ã«ããããŠãŒã¶ãŒã¯ã䜿çšè
ã«çŽä»ããããã¢ã«ãŠã³ãã®ããšãæããŸãã
ããã¯è€éãªãã®ã§ã¯ãããŸãããã¡ã€ã³ã¯ãã°ã€ã³æ
å ±ããšã«ç»é²ãããå人æ
å ±ã§ãã
ãŸãããŠãŒã¶ãŒã¢ã«ãŠã³ãã«ã¯ åå空é ãèšå®ãããŠããŠããŠãŒã¶ãŒãä¿æãããããžã§ã¯ãã®èå¥åãšããŠçšããããŸãã
ããšãã°ããŠãŒã¶ãŒ jane
ã project
ãšããååã®ãããžã§ã¯ããä¿æããŠããå Žåã¯ããã®ãããžã§ã¯ãã® URL 㯠http://server/jane/project
ã«ãªããŸãã
ãŠãŒã¶ãŒãåé€ããå Žåãããæ¹ã¯2ã€ã§ãã ãŸãã¯ãŠãŒã¶ãŒãããããã¯ãããæ¹æ³ã§ãããã®å Žåããããã¯ããããŠãŒã¶ãŒã¯ GitLab ã«ã¯ãã°ã€ã³ã§ããªããªããŸããäžæ¹ããŠãŒã¶ãŒã®åå空éé äžã®ããŒã¿ã¯åé€ãããããŠãŒã¶ãŒã®ã¡ãŒã«ã¢ãã¬ã¹ã§çœ²åãããã³ããããšãŠãŒã¶ãŒãããã¡ã€ã«ãšã®é¢é£ä»ããæå¹ãªãŸãŸã«ãªããŸãã
ããã²ãšã€ã®ããæ¹ã¯ãŠãŒã¶ãŒããç Žå£ãããæ¹æ³ã§ãããŠãŒã¶ãŒãç Žå£ãããšãGitLab ã®ããŒã¿ããŒã¹ããã¡ã€ã«ã·ã¹ãã ããåé€ãããŸãã ãŠãŒã¶ãŒã®åå空éé äžã®ããŒã¿ã»ãããžã§ã¯ããåé€ãããŸããããã®ãŠãŒã¶ãŒãäœæããã°ã«ãŒããåãããã«åé€ãããŸãã ãã®æ¹æ³ã¯ããããã¯ããšæ¯ã¹ã¯ããã«æä¹ çã§ããçŽãããããªããã®ã§ãããã£ãŠã䜿ãããããšã¯ãã£ãã«ãããŸããã
ã°ã«ãŒã
GitLab ã§ã¯ãè€æ°ã®ãããžã§ã¯ããã°ã«ãŒããšããŠãŸãšããããŸãããããŠãã°ã«ãŒãã«ã¯ãããžã§ã¯ãããšã®ãŠãŒã¶ãŒã®ã¢ã¯ã»ã¹æš©æ
å ±ãå«ãŸããŠããŸãã
ãŸãããŠãŒã¶ãŒã®å Žåãšåãããã«ãããããã®ã°ã«ãŒãã«ã¯åå空éããããŸããããšãã°ã training
ã°ã«ãŒãã« materials
ãšãããããžã§ã¯ãããã£ãå ŽåãURL 㯠http://server/training/materials
ã«ãªããŸãã
ã°ã«ãŒãã«ã¯ã¡ã³ããŒãè¿œå ã§ããŸããããã«ãã¡ã³ããŒããããã«ãããžã§ã¯ãããšã®æš©éãšãã°ã«ãŒããã®ãã®ã«å¯Ÿããæš©éãèšå®ã§ããŸãã æš©é㯠âGuestâ ïŒissues ãšãã£ããã®ã¿ïŒãã âOwnerâ ïŒã°ã«ãŒããšé äžã®ã¡ã³ããŒã»ãããžã§ã¯ãã®ç®¡çæš©éïŒãŸã§ãçšæãããŠããŸãã åæš©éã®è©³çŽ°ã¯èšå€§ãªããçç¥ããŸããã管çç»é¢ã«ãããªã³ã¯ã蟿ããšç¢ºèªã§ããããã«ãªã£ãŠããŸãã
ãããžã§ã¯ã
GitLab ã®ãããžã§ã¯ããšã¯ã倧äœã®å Žåã²ãšã€ã® Git ã®ãªããžããªãæããŸãã ãªãããã®åå空éïŒãŠãŒã¶ãŒãã°ã«ãŒãïŒã«ããããžã§ã¯ãã¯ãã¹ãŠå±ããŠããŸãã ãããžã§ã¯ãããŠãŒã¶ãŒã®åå空éã«å±ããŠããã°ããã®ãªãŒããŒã¯ã¢ã¯ã»ã¹æš©ããã¹ãŠç®¡çã§ããŸãããããžã§ã¯ããã°ã«ãŒãã«å±ããŠããã°ãã°ã«ãŒãèªäœã®ã¢ã¯ã»ã¹æš©èšå®ããããžã§ã¯ãã«ãåŒãç¶ãããŸãã
ãŸãããããžã§ã¯ãã«ã¯å ¬éã¬ãã«èšå®ããããã©ã®ãŠãŒã¶ãŒã«ãããžã§ã¯ãã®ããŒãžãšãªããžããªã®èªã¿èŸŒã¿æš©éãäžããããèšå®ã§ããŸãã ãããžã§ã¯ãã Private ã®å Žåãã¢ã¯ã»ã¹æš©ããŠãŒã¶ãŒããšã«æ瀺çã«èšå®ããå¿ èŠããããŸãã ãããžã§ã¯ãã Internal ã®å Žåã¯ãã°ã€ã³æžã¿ã®ãŠãŒã¶ãŒã§ããã°é²èŠ§ã§ããPublic ãªãããžã§ã¯ãã§ããã°èª°ã§ãé²èŠ§ã§ããŸãã ãªãããã®èšå®ã§ãGit ã® âfetchâ ã³ãã³ããš ãŠã§ãç»é¢ã®äž¡æ¹ã®ã¢ã¯ã»ã¹æš©ãèšå®ãããããšã«æ³šæããŸãããã
ããã¯
GitLab ã¯ããã¯ïŒãããžã§ã¯ãã»ã·ã¹ãã ã®äž¡æ¹ïŒã«å¯Ÿå¿ããŠããŸãã ã©ã¡ãã®ããã¯ã§ããã該åœã®ã€ãã³ããçºçããéœåºŠãGitLab ã®ãµãŒããŒã¯ JSON ããŒã¿ã䜿ã£ãŠ HTTP POST ãªã¯ãšã¹ããçºè¡ããŸãã ããã¯ãGit ãªããžããªã GitLab ãéçºèªååã®ä»çµã¿ãšé£æºããããšãã«ãšãŠã䟿å©ã§ããç¹ã« CI ãµãŒããŒã»ãã£ãããµãŒãã¹ã»ãããã€çšã®ããŒã«ãªã©ãšã®é£æºã«åœ¹ç«ã€ã§ãããã
åºæ¬çãªäœ¿ãæ¹
GitLab ã§æåã«ããã¹ãããšã¯ãæ°èŠãããžã§ã¯ãã®äœæã§ãã ããŒã«ããŒã® â+â ã¢ã€ã³ã³ãã¯ãªãã¯ãããšäœæãå§ãŸããŸãã ãŸãããããžã§ã¯ãå称ã»æå±ãã¹ãåå空éã»å ¬éã¬ãã«èšå®ãäœææã«å ¥åããŸãã ãããã®å€§åã¯èšå®ç»é¢ããããšããå€æŽå¯èœã§ãã 次㫠âCreate Projectâ ãã¯ãªãã¯ããã°ããããžã§ã¯ããäœæãããŸãã
ãããžã§ã¯ããäœæããããããŸãã¯æå ã® Git ãªããžããªãšãã®ãããžã§ã¯ããé¢é£ä»ãããšããã§ãããã ãããžã§ã¯ãã«ã¢ã¯ã»ã¹ããã«ã¯ HTTPS ã SSH ã䜿ããŸãããããããGit ã®ãªã¢ãŒããšããŠèšå®å¯èœãªãããã³ã«ã§ãã èšå®çšã® URL ã¯ããããžã§ã¯ãã®ããŒãžã®æäžéšã«è¡šç€ºãããŠããŸãã
$ git remote add gitlab https://server/namespace/project.git
æå ã« Git ãªããžããªããªãå Žåã¯ã以äžã®ããã«ããŠãªã¢ãŒãããã¯ããŒã³ããŸãããã
$ git clone https://server/namespace/project.git
GitLab ã® ãŠã§ãç»é¢ã«ã¯ããªããžããªã®æ å ±ã確èªãã䟿å©ãªç»é¢ãããã€ããããŸãã ãããžã§ã¯ãã®ãããããŒãžã§ã¯æè¿ã®è¡åå±¥æŽã確èªã§ããŸãããç»é¢äžéšã«ãããªã³ã¯ããã©ããšãã¡ã€ã«äžèŠ§ãã³ããããã°ã確èªã§ããŸãã
å ±åäœæ¥
GitLab ã§ãã¹ãããŠãããããžã§ã¯ãã§å ±åäœæ¥ãè¡ããã£ãšãã·ã³ãã«ãªæ¹æ³ã¯ãGit ãªããžããªãžã®ããã·ã¥ã¢ã¯ã»ã¹æš©ãçžæã«äžããŠããŸãããšã§ãã ãŠãŒã¶ãŒããããžã§ã¯ãã«è¿œå ããã«ã¯ããããžã§ã¯ãã®èšå®ç»é¢ã«ãã âMembersâ ã®ã»ã¯ã·ã§ã³ã䜿ããŸããæ°èŠãŠãŒã¶ãŒã«ã¢ã¯ã»ã¹æš©ãèšå®ããã®ã«ãåãã»ã¯ã·ã§ã³ã䜿ããŸãïŒã¢ã¯ã»ã¹æš©ã®è©³çŽ°ã«ã€ããŠã¯ã ã°ã«ãŒã ã§ãå°ã觊ããŸããïŒã ãŠãŒã¶ãŒã«ä»äžãããæš©éã âDeveloperâ ããã以äžã§ããã°ããªããžããªãžã³ãããããã©ã³ããåé¡ãªãçŽæ¥ããã·ã¥ã§ããŸãã
ããã²ãšã€ãããççµåãªå
±åäœæ¥ã®æ¹æ³ããããŸããããŒãžãªã¯ãšã¹ãã§ãã
ãã®æ©èœã䜿ãã°ãä»»æã®ãŠãŒã¶ãŒïŒãããžã§ã¯ããé²èŠ§å¯èœãªãŠãŒã¶ãŒã«éãããŸãïŒã«æå®ã®æ¹æ³ã§å
±åäœæ¥ã«åå ããŠããããŸãã
ãŸãããªããžããªã«çŽæ¥ããã·ã¥ããæš©éã®ãããŠãŒã¶ãŒã®å Žåã¯ããã©ã³ããäœã£ãŠã³ããããããã·ã¥ããããã§ããã®ãã©ã³ããã master
ãªã©åžæãããã©ã³ãã«åããŠããŒãžãªã¯ãšã¹ããäœæããŸãã
äžæ¹ãããã·ã¥æš©éã®ãªããŠãŒã¶ãŒã®å ŽåããŸãã¯ãªããžããªãããã©ãŒã¯ãïŒèªåå°çšã®ã³ããŒãäœæïŒããŸããç¶ã㊠ãã® ã³ããŒã«ã³ããããããã·ã¥ããããã³ããŒããæ¬å®¶ã«åããŠããŒãžãªã¯ãšã¹ããäœæããŸãããã
ãã®æ¹æ³ã䜿ãã°ãã©ããªå€æŽããã€ãªããžããªã«è¿œå ããããã管çè
ã管çãã€ã€ãä»»æã®ãŠãŒã¶ãŒã«å
±åäœæ¥ã«åå ããŠããããŸãã
GitLab ã«ãããŠã¯ãããŒãžãªã¯ãšã¹ãã issue ã䜿ã£ãŠè°è«ãæ·±ããŠãããŸãã ããŒãžãªã¯ãšã¹ãã¯ãå€æŽå 容ã«ã€ããŠè¡ããšã«è°è«ããããšïŒç°¡æçãªã³ãŒãã¬ãã¥ãŒæ©èœãšããŠã䜿ããŸãïŒã«ã䜿ããŸãããããŒãžãªã¯ãšã¹ãå šäœã«ã€ããŠã®è°è«ã®ã¹ã¬ãããšããŠã䜿ããŸãã ãŸããããŒãžãªã¯ãšã¹ãã issue ã«ã¯æ åœè ãèšå®ã§ããŸããããã€ã«ã¹ããŒã³ã®äžéšã«ããªããŸãã
ãã®ç¯ã§ã¯äž»ã« GitLab ã® Git é¢é£éšåãèŠãŠããŸããããã ãGitLab ã¯ãšãŠãå®æ床ã®é«ãã·ã¹ãã ã§ãå ±åäœæ¥ã«åœ¹ç«ã€æ©èœã¯ä»ã«ããããããããŸããããšãã°ããããžã§ã¯ãçšã® wiki ãã·ã¹ãã 管çããŒã«ãªã©ã§ãã æåŸã« GitLab ã®å©ç¹ãšããŠããäžç¹æããŠãããŸããããGitLab ã¯ãäžåºŠã»ããã¢ãããçµãã£ãŠãµãŒããŒãåãåºãã°ãèšå®ãã¡ã€ã«ãããã£ãããµãŒããŒã« SSH ã§ãã°ã€ã³ãããããå¿ èŠã¯ã»ãšãã©ãããŸããã管çäœæ¥ããããŠéåžžå©çšã®å€§åã¯ããã©ãŠã¶ç»é¢ããæäœã§ããŸãã