GITã§ãªã¢ã¼ããã©ã³ãã¸pushããåã«ãã£ã¦ããã¹ããã¨
å
æ¥GITã使ã£ã¦ã¦ãã¡ãã£ã¨ãç²æ«ãªãã¹ããã¦ãã¾ãã¾ããã
ä»æ¥ã¯ãããªãã¹ãç¯ããªãããã«ãã£ã¦ããã¹ããã¨ã«ã¤ãã¦æ¸ãããã¨æãã¾ãã
ãç²æ«ãªãã¹
ç§ããã£ã¡ãã£ããã¹ã¯ããã°ããã³ãããã°ã©ãæ±ããã§ããå³ã®ããã«ããå¥ã®äººãã¨ã®ãã¼ã¸ã³ããããã³ãããã°ã©ãã«è¿½å ãã¦ãã¾ãã¾ããã
ãã®ã¨ãã®ã³ãããã°ã©ã
ãã¼ã¸ã³ãããã®ã¡ãã»ã¼ã¸ã¯
ãMerge branch 'xxxx' of ....ã ãMerge commit 'xxxx'ã
ã¨ããæ¬è³ªçã§ãªãã¡ãã»ã¼ã¸ã«ãªãã¾ãã
ãã®ããã¼ã¸ãããã¨ããæ
å ±ã¯ãèªå <==> ããæç¹ã§ã®ã³ããããã®ãã¼ã¸ãæãã¦ããããã¼ã å
¨ä½ï¼ãªã¢ã¼ãï¼ã¨ãã¦æèãããããªã³ããããã°ã§ã¯ããã¾ããã
ãã®ãããªã³ãããããã¦ãã¾ã£ããã¨ã«ãã£ã¦ããªã¢ã¼ããã©ã³ãã®ã³ãããã°ã©ãã®è¦éããæªããã¦ãã¾ãã¾ããã
æ¬æ¥ã¯ãã®ãããªã³ããããã°ã¯å«ã¾ããå人ã®å¤æ´ããå 容ãéç´ããã¦ã³ãããã°ã©ããå½¢æãããã¹ãã ã¨æãã¾ãã
ãªã¢ã¼ããã©ã³ãã®ããã¹ãã³ãããã°ã©ãã®å§¿
ä»åã¯ãã®ãããªã³ãããã°ã©ãã®ããã¹ã姿ãä¿ã¤ããã®æ¹æ³ãã¾ã¨ãã¦ã¿ããã¨æãã¾ãã
ã2013/06/30ã
ã³ã¡ã³ããåãã¦ããªã¢ã¼ããã©ã³ãã®ããã¹ãã³ãããã°ã©ãã®å§¿ãã®ç»åãå·®ãæ¿ãã¾ããã
ï¼å
ã®å³ã¯ã³ãã©ï¼
ã
ã¾ãã¯gitxã®å°å ¥
ã¾ãã¯gitxãå°å ¥ãããã¨ãã¹ã¿ã¼ãã©ã¤ã³ã«ãªãã¨æãã¾ããå°å ¥ã¯ã¨ã¦ãç°¡åã§ãã¦ã³ãã¼ããã¦è§£åããã ãã§ãã
å°å ¥å¾ãã¡ãã¥ã¼ãããGitXãâãEnable Terminal Usage...ããé¸æããã¨ã³ãã³ãã©ã¤ã³ãããgitxããå®è¡åºæ¥ãããã«ãªãã¾ãã
gitxã¯ã³ããããã°ãã³ãããã°ã©ããGUIã§è¦ãããã¼ã«ã§ãã
ãã¼ã«ã«ï¼ãªã¢ã¼ãã®è¤æ°ãã©ã³ãã®ç¶æ
ãåããã¦ã¿ããåºæ¥ããããè¦è¦çã«åããããããã¼ã«ã ã¨æãã¾ããï¼Winç³»ã ã¨ä¼¼ããããªãã®ã§gitkã¨ãããã¼ã«ãããã¾ããï¼
ã³ãããï¼ãã¼ã¸ï¼ãªãã¼ã¹çãå®è¡ãããã³ã«gitxã§æ³å®éãã®ã³ããããã°ãã³ãããã°ã©ãã¨ãªã£ã¦ãããï¼ã確èªããªããé²ãã¦ããã®ãè¯ãã¨æãã¾ãã
ããã§ã¯æ¬é¡
ããã§ã¯æ¬é¡ã®ã©ãããã°ãªã¢ã¼ãã®ã³ãããã°ã©ããæ±ããã«æ¸ãã®ãï¼ã«ã¤ãã¦ãå ¨ä½ã®ã¤ã¡ã¼ã¸ã¯ãã®ããã«ãªãã¾ãã
ãã¼ã«ã«ã®masterãã©ã³ãã§ãªã¢ã¼ããã©ã³ãã¨åæãåããªãããèªåã®ä½æ¥ã¯workãã©ã³ãã«ã³ããããã¦ããããã«ãã¾ãã
以éã§ã¯ãã®å³ãå ã«ãã²ã¨ã¤ã²ã¨ã¤æé ãå±éãã¦ããããã¨æãã¾ãã
(1)ä½æ¥ç¨ãã©ã³ãï¼workï¼ãä½æãã
ã¾ãã¯ä½æ¥ç¨ãã©ã³ãï¼workï¼ãä½æãã¾ãããgit checkout -bããå©ç¨ããã¨ä½æï¼ãã®ãã©ã³ãã¸ã®ç§»åãåæã«å®æ½ã§ãã¾ãã
git checkout -b work
(2)ããããéçºãã³ããã
é常éãéçºããä½æ¥ç¨ãã©ã³ãï¼workï¼ã¸ã³ããããã¾ããgit commit
(3)ãªã¢ã¼ããã©ã³ãã¨åæ
ããããéçºãã¦ããã¨ããããããªã¢ã¼ãã¸pushããããªãã¨æãã¾ããããæã£ããã¾ãã¯masterãã©ã³ãã¨ãªã¢ã¼ããã©ã³ãã®åæãåãã¾ãã
ãã®æç¹ã§ãå¥ã®äººããpushãã¦ããå 容ãåå¾ãã¾ãã
git checkout master git pull origin master
(4)masterãã©ã³ãããã¼ã¹ã«ä½æ¥ç¨ãã©ã³ãï¼workï¼ããªãã¼ã¹
ãããï¼çªã®ãã¤ã³ãã§ãããªã¢ã¼ããã©ã³ãã®ææ°ã¨åæãåã£ãmasterãã©ã³ãããã¼ã¹ã«ä½æ¥ç¨ãã©ã³ãï¼workï¼ããªãã¼ã¹ãã¾ãã
ããã§ãªãã¼ã¹ãããã¨ã«ãã£ã¦ãã¼ã¸ã³ããããçºçãããªãããã«ãã¾ãã
git checkout work git rebase master
(5)ä½æ¥ç¨ãã©ã³ãããã¼ã¹ã«masterãã©ã³ãããªãã¼ã¹
ä»åº¦ã¯éã«ä½æ¥ç¨ãã©ã³ãï¼workï¼ããã¼ã¹ã«masterãã©ã³ãããªãã¼ã¹ãã¾ããããã§ã®ç®çã¯ãmaster ï¼ workãã¨ããåãªãä½ç½®åãããªã®ã§ããgit merge --ff-onlyããå©ç¨ãã¦ãOKã§ãã
git checkout master git rebase work ï¼ããã㯠git merge --ff-only workï¼
(6)ãªã¢ã¼ããã©ã³ãã¸push
ããã¾ã§ä½æ¥ãããgitxã§ã³ãããã°ã©ãã確èªãã¾ãããã£ã¨ç¶ºéºãªã³ãããã°ã©ãã«ãªã£ã¦ããã¨æãã®ã§ããã®ç¢ºèªãæ¸ãã ããªã¢ã¼ããã©ã³ãã¸pushãã¾ãã
git push origin master
â»ããgitxã§ç¢ºèªããçµæãæãéãã«ãªã£ã¦ããªããã°å ã«æ»ãã¾ãããã
git reset --soft xxxxxxx
ããã§ç·¨éãããã¡ã¤ã«ã¯ãã®ã¾ã¾ã«ãã³ããããã°ã ããåãæ¶ããã¨ãåºæ¥ã¾ãã
ã¾ã¨ã
ä»åã¯ã³ãããã°ã©ããæ±ãã¦ãã¾ããªãããã®ï¼ã¤ã®æ¹æ³ã示ãã¾ããããã¼ã«ã«ãã©ã³ãã®ãmaster <==> workãã§æ´åæ§ãä¿ã£ãä¸ã§ãããããã®ã¾ã¾ãªã¢ã¼ãã¸pushããã¨ããã®ããããããä¿è¨¼ã§ãã¦è¯ãã¨æã£ã¦ãã¾ãã
ã¾ãããªã¢ã¼ããã©ã³ãã¸pushããåã«ãã¨ãããã¼ãã§ããããããã¯ãpull requestãéãåã«ãã¨ãèªã¿ä»£ãããã¨ãåºæ¥ã¾ãã
OSSããã¸ã§ã¯ãããã®ä»ä½ã«å¯¾ãã¦ãã§ãããã³ãããã°ã©ããæèããã¨ã¬ã¬ã³ããªpull requestãéããããã®ã§ããã