é·å¹´MinGW/MSYSã使ãç¶ãã¦ããã®ã§ããã©ãæè¿ãã¾ãã¢ãããã¼ãããã¾ãããä¾ãã°ãbashã¯9å¹´åã®version 3.1ã®ã¾ã¾ã§ããä¸éã§ã¯version 4.2, 4.3ã使ããã¦ããã®ã«ã
MinGW/MSYSã®å¾ç¶ãããMingw-w64ã¨MSYS2ã®çµã¿åããã«æ¿ããããã¨æã£ãã®ã§ãããGit for Windowsãããã°ååãªæ°ããã¦ãã¾ããã
å 容ï¼
- MinGWã¨MSYS
- ãã£ã¬ã¯ããªã¬ã¤ã¢ã¦ãã¨PATHç°å¢å¤æ°
- Mingw-w64ã¨MSYS2
- Git for Windowsã®ã·ã§ã«ç°å¢
- ã¾ã¨ã
MinGWã¨MSYS
MinGWã¨MSYSã¯ä¸ç·ã«ä½¿ã£ã¦ãã人ãå¤ãã¨æãã¾ãããç®çãç°ãªã2ã¤ã®ã·ã¹ãã ã§ããMinGW/MSYSã¨ããæ¯è¼ãããCygwinã¯ãåä¸ã®ã·ã¹ãã ã¨ãã¦Windowsä¸ã«POSIXç°å¢ãå®ç¾ãããã®ã§ã -- ç®çãæ¹å¼ãæå¿«ã§ããããã«å¯¾ãã¦ãMinGW/MSYSã¯ã¡ãã£ã¨åããã«ããæ§æã«ãªã£ã¦ãã¾ãã
MinGWã¯Windowsã§ä½¿ããã³ã³ãã¤ã©ã»ãã¼ã«ããããªãã§ããgcc, g++ããªã³ã«ãã¢ã»ã³ãã©ããããã¬ãªã©ä¸å¼ã§ããã³ãã³ãã©ã¤ã³ãã¼ã«ç¾¤ãªã®ã§ãcmd.exeããç´æ¥ä½¿ã£ã¦ããIDEã®ããã¯ã¨ã³ãã«ä½¿ã£ã¦ããã¾ãã¾ãããCygwinããMinGWã使ããã¨ãã§ãã¾ããã³ãã³ãåããCygwinã®gccãã¨ãã¶ãã®ã§ãmingw32-gcc, i686-w64-mingw32-gcc ãªãã¦å¥åãæºåããã¦ãã¾ãã
ããä¸æ¹ã®MSYSã¯ãã¦ã¼ã¶ã¼ã対話çã«ä½¿ãPOSIXã·ã§ã«ç°å¢ãæä¾ãã¾ããbashã¨ããã¾ãã¾ãªã¦ã¼ãã£ãªãã£ã³ãã³ã群ãããªãã¾ããMSYSã使ãã°ãUnix/Linuxä¸ã®ã·ã§ã«ã¹ã¯ãªãããï¼å¤ãã®å ´åå°ãã®ä¿®æ£ã§ï¼Windowsä¸ã§ãå®è¡å¯è½ã¨ãªãã¾ãã
ãMicrosoft Visual C++ã®ã³ãã³ãã©ã¤ã³çã®ä»£æ¿ã¨ãªãå¾ãéçºãã¼ã«ããMinGWããPowerShellã®ä»£æ¿ã¨ãªãå¾ãé«æ©è½ã·ã§ã«ããMSYSãã¨æãã°ããã§ãããã
éçºãã¼ã«ã§ããMinGWããã·ã§ã«ç°å¢MSYSãã使ãå ´åãå¤ãã®ã¯ç¢ºãã§ãããã©ã¡ããä¸æ¹ã ããã¤ã³ã¹ãã¼ã«ãã¦ä½¿ããã¨ãã§ãã¾ããä¾ãã°ãã³ã³ãã¤ã©ãå¿ è¦ãªã人ã¯MSYSï¼bashç°å¢ï¼ã ããå©ç¨ã§ãã¾ãã
ãã£ã¬ã¯ããªã¬ã¤ã¢ã¦ãã¨PATHç°å¢å¤æ°
ç¾å¨ã®MinGW/MSYSã¯ãããã±ã¼ã¸ããã¼ã¸ã£mingw-getã使ã£ã¦ã¤ã³ã¹ãã¼ã«ï¼ã¢ãããã¼ããã¾ã*1ãhttp://sourceforge.net/projects/mingw/files/ ããmingw-getã®ã¤ã³ã¹ãã¼ã©ã¼ã§ããmingw-get-setup.exeãå ¥æããã°ããããããã¼ãã¹ãã©ããã³ã°ãã¦å¸æã®ã·ã¹ãã ãæ§æã§ãã¾ããä¾ãã°ãmsys-baseããã±ã¼ã¸ãå°å ¥ããã°MSYSã·ã§ã«ç°å¢ãæã«å ¥ãã¾ã*2ã
MinGWãã¤ã³ã¹ãã¼ã«ããããã£ã¬ã¯ããªã$MinGWã¨ããã¨ãæ¨æºçãªæ§æã§ã¯ï¼
- $MinGW\bin\ ã«éçºãã¼ã«ã®ã³ãã³ã群ãå ¥ãã
- $MinGW\msys\1.0\ ã®ä¸ã«MSYSä¸å¼ãå ¥ãã
ãã ããMSYSã®ãã£ã¬ã¯ããªã¯èªç±ã«é¸ã¹ãï¼ä¾ãã°ãC:\MSYSï¼ã®ã§ã以ä¸ã§ã¯$MSYSã¨è¨ãã¾ãã
MSYSç°å¢å ã§ã¯ãWindowsã®ãã£ã¬ã¯ããª$MSYSãã«ã¼ãï¼/ï¼ã«è¦ãã¾ããWindowsã®ãã©ã¤ãã¯ã/cã/d ã®ãããªãã£ã¬ã¯ããªã¨ãã¦ãã¦ã³ãããã¾ãããã以å¤ã«ã/etc/fstabã®è¨è¿°ã«ãããã¦ã³ããè¡ãã¾ããMSYSããMinGWéçºãã¼ã«ã使ãã¨ãã¯ã$MINGWã/mingwã«ãã¦ã³ãããã®ãç¿æ £ã§ããããããã¨ã/mingw/msys/1.0/ ãåã³ã«ã¼ãï¼/ï¼ã«æ»ã循ç°æ§é ãã§ãã¾ãããç¹ã«åé¡ã¯ããã¾ããã
PATHç°å¢å¤æ°ã¯ãWindowsã®ãã®ããã®ã¾ã¾å¼ãç¶ããã¾ãï¼C:\Windows â /c/Windows ã®ãããªå¤æã¯åãã¾ããï¼ã/usr/local/bin, /usr/bin, /bin ï¼å ´åã«ãã /mingw/binï¼ãªã©ãMSYSã«ããPAHTã®å é ã«è¿½å ããã¾ããããã«ããä¾ãã°ã/bin/find ã C:\Windows\System32\find.exe ããåªå ãããããã«ãªãã¾ãã
Mingw-w64ã¨MSYS2
MinGWã®ã³ã³ãã¤ã©ã¯32ããããã¤ããªããçæã§ãã¾ããã64ããããã¤ããªãçæå¯è½ãªWindowsåãGCCã¨ãã¦Mingw-w64ãããã¾ããã¾ããããæ°ãããã¼ã¸ã§ã³ã®GNUã½ããã¦ã§ã¢ããã¼ã¹ã«ããMSYS2ãããã¾ãã
Mingw-w64ã¨MSYS2ãæ°ãã«ã¤ã³ã¹ãã¼ã«ãããã¨æã£ãã®ã§ãããå¾ ã¦ããã¨ãGit for WindowsããMingw-w64/MSYS2ãå«ãã§ãããã§ããããããããã®ã¾ã¾ä½¿ãã°ããããããªããããã
Git for Windowsã«ã³ã³ãã¤ã©ãªã©ã®éçºãã¼ã«ã¯å ¥ã£ã¦ã¾ããããããã¯å¾æ¥ã®32ãããMinGWã§ããã ãããã¨ãã¾ãã64ãããGCCã«ã¯TDM-GCCã¨ããé¸æè¢ããã£ã¦ãTDM-GCCã®ã»ãã使ãããããã§ããGCCã«æããªããªããMicrosoftã®Visual Studio Communityãããã¾ããã
[追è¨]TDM-GCCå ¥ãã¦ã¿ã¾ããã tdm64-gcc-5.1.0-2.exeããã¦ã³ãã¼ãããã¨ããããæåã®ã¤ã³ã¹ãã¼ã«ããå¾ããã®æ§æå¤æ´ï¼ã³ã³ãã¤ã©ï¼é¢é£ãã¼ã«ã®è¿½å ãåé¤ï¼ããã£ã¦ããã¾ããã·ã³ãã«ã§ä½¿ãåæãããã§ããã[/追è¨]
Git for Windowsã®ã·ã§ã«ç°å¢
çµè«ããè¨ãã¨ãWindowsã®ç°å¢å¤æ°ããããã«ä¿®æ£ããã ãã§åã®ç®çã¯éæã§ãã¾ããã
Windowsã®ã¬ãã«ã§ã$Git\usr\bin ã $MSYS\binï¼å¾æ¥ã®MSYSï¼ ããåã«æ¥ãããã«PATHãè¨å®ããã ãã§ããbashèµ·åãã¢ã¤ã³ã³ããã«éå®ãããªããã®ä½æ¥ããå¿ è¦ããã¾ããï¼ä½ããããã¨ããªãï¼ã
çµæçã«ã¯ãããã¨ããªãã®ã§ããããä½ãããªãã¦ã大ä¸å¤«ã ãã¨ç´å¾ããããã«Git for Windowsã®æ§é ã調ã¹ã¾ãããããã«ã¤ãã¦è¨ãã¦ããã¾ãããã
Git for Windowsã¯ãMSYS2ï¼Î±ãªã®ã§ãããï¼Î±ãé¨åã¯ãã¡ããWindowsåãã«èª¿æ´ãããgitã³ãã³ãã§ããMSYS2ã®ã³ãã³ã群ï¼bashãlsãªã©ï¼ã¯å ¨ã¦$Git/usr/binã«å ¥ã£ã¦ãã¾ããGit for Windowsç¹æã®ã³ãã³ãã¯æ¬¡ã®ãã®ã§ãã
- $Git/ ã« git-bash.exe, git-cmd.exe
- $Git/bin/ ã« bash.exe, sh.exe, git.exe
- $Git/cmd/ ã« git.exe, git-gui.exe, gitk.exe, start-ssh-agent.cmd
- $Git/mingw64/bin/ ã« git.exe, curl.exe ãªã©
bash.exeãgit.exeãã¢ãã³ãã«è¤æ°ãã£ã¦ä¸å®ã«ãªã£ãã®ã§ããã次ã®ãããªãã¨ã¿ããã
- Windowsã¦ã¼ã¶ã¼ã«å¯¾ãã¦ã$Git/git-bash.exe ã¾ã㯠$Git/git-cmd.exe ãGitæä½ç¨ã¤ã³ã¿ã¼ãã§ã¤ã¹ãæä¾ããã
- $Git/git-bash.exeã¯ãbashãå®è¡ããã$Git/git-cmd.exeã¯cmd.exeãå®è¡ããã
- ï¼$Git/git-cmd.exeã¯ã©ãã§ãããã¨ãã¦ï¼$Git/git-bash.exeã¯ãæ°ããã³ã³ã½ã¼ã«ã¦ã£ã³ãã¦å ã§$Git/bin/bash.exeãèµ·åããã
- $Git/bin/bash.exeã¯ãç°å¢å¤æ°MSYSTEMãMINGW64ã«è¨å®ãã¦ã$Git/usr/bin/bash.exeãèµ·åããã
ç°å¢å¤æ°MSYSTEMãMINGW64ã«ã»ããããã®ã¯ãbashã®ã¹ã¿ã¼ãã¢ãããã¡ã¤ã«ã§ãã/etc/profileå ã§ãPATHã« /mingw64/bin ã追å ãããããã§ããgitã³ãã³ãã®æ¬ä½ã¯ /mingw64/bin/git.exe ãªã®ã§ãããå¿ è¦ã§ãã
ã¨ãããããWindowsã«ãããGitå©ç¨ç°å¢ã¯æ´ã£ãï¼ Git for Windows 㨠SourceTree for Windowsãã§èª¬æããæ¹æ³ã§Git for Windowsãã¤ã³ã¹ãã¼ã«ãã¦ããã°ãPATHã«$Git/cmd/ãå ¥ã£ã¦ããã$Git/cmd/git.exeãçµç±ãã¦$Git/mingw64/bin/git.exeãèµ·åã§ãã¾ãã
çµå±ãã©ããã¼ã§ãã$Git/git-bash.exeã$Git/bin/git.exeã¯ç¡è¦ãã¦ãããã¦*3ãç´æ¥ã«$Git/usr/bin/bash.exeãèµ·åãã¦ãããã®ã§ããbashãå¿ è¦ã¨ãã /user/bin, /bin ãªã©ã¯/etc/profileã§è¿½å ããã¾ããä»ã®ã·ã§ã«ï¼cmed.exeãPowerShellï¼ããlsãããbashãèµ·åãããããã¨ããçç±ã§ãWindowsã¬ãã«ã§$Git\usr\binãPATHã«è¿½å ãã¦ãããã»ãã便å©ãã¨ããã ãã§ãã
ã¾ã¨ã
ä½ãããªãã¦ããå²ã«ã¯ã´ãã£ã´ãã£ãã¦ããã®ã§äºæ ãã¾ã¨ãã¦ããã¾ãã
- cmd.exeãPowerShellããbash, lsãªã©ã®MSYSã³ãã³ãã使ãããå ´åï¼ Windowsã®ç°å¢å¤æ°PATHã«$Git\usr\binãå ããã
- ã·ã§ã¼ãã«ããã¢ã¤ã³ã³ããã«ãã¹ã§bashãèµ·åãã¦ä½¿ãå ´åï¼ èµ·åããããã°ã©ã ã¨ãã¦$Git\usr\bin\bash.exeãæå®ããã/etc/profile 㨠~/.profile ãå®è¡ãããã«ã¯ --login ãªãã·ã§ã³ãä»ããã
- gitãå®è¡ããããã«ã¯ã$Git\cmdãPATHã«å ¥ã£ã¦ããå¿ è¦ãããã
ãªããGit for Windowsãã¤ã³ã¹ãã¼ã«ããã¨ãã"Adjusting your PATH environment"ã®ãã¤ã¢ãã°ã«ããã¦"Run Git and induced Unix tools from the Windows Command Prompt."ãé¸ã¶ã¨ãgitã¨ï¼bashèªèº«ãå«ãï¼MSYSã³ãã³ã群ã使ããããã«è¨å®ãã¦ããã¾ãã次ã®ãã£ã¬ã¯ããªããã®é ã§PATHã«è¿½å ãã¾ãã
- $Git\cmd
- $Git\mingw64\bin
- $Git\usr\bin
èããã®ãé¢åãªããè¨å®ãå¤ãã¦åã¤ã³ã¹ãã¼ã«ãã¦ãã¾ãã®ãä¸çªæã£åãæ©ãã§ãã
*1:mingw-getã®GUIã¯ä¾¿å©ã§ãããGUIã¨ã³ãã³ãã©ã¤ã³ã§æåãéãã¨ããåãããã¾ãã
*2:ä»ã®ã½ããã¦ã§ã¢ãä¾ãã°Ruby DebKitãHaskell Platformãgnupackãªã©ã«MinGW/MSYSãå梱ããã¦ãã¾ããVagrantãCoqãMinGWã³ãã³ãã®ä¸é¨ãå é¨ã«æã£ã¦ãã¾ãããªã®ã§ãåãã³ãã³ãããã£ã¹ã¯ã®ã¢ãã³ãã«éè¤ãã¦åå¨ããäºæ ã«ãªãã¾ãã
*3:$Git/git-bash.exe 㨠$Git/bin/* ã¯ãGitã³ã³ã½ã¼ã«ã ãã§éããç°å¢ãä½ãããã®ãã®ã§ããMSYS2ãæ®éã«å©ç¨ããã¨ãã«ã¯ç¡ç¨ã§ãã