Guest User

Untitled

a guest
Nov 12th, 2017
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.13 KB | None | 0 0
  1. git init merge_test
  2. # Initialized empty Git repository in /vagrant/merge_test/.git/
  3.  
  4. cd merge_test
  5. echo "First commit." > a_file
  6. git commit -am "First commit."
  7.  
  8. git log
  9. # commit eb4173dbd9589057e4fa0df089de781b33db9f5c (HEAD -> master)
  10. # Author: vagrant <vagrant@localhost.localdomain>
  11. # Date: Thu Nov 9 03:19:43 2017 +0000
  12. #
  13. # First commit.
  14.  
  15. git branch feature
  16. git branch develop
  17. git checkout feature
  18. # Switched to branch 'feature'
  19.  
  20. echo "Second commit." >> a_file
  21. git commit -am "Second commit."
  22. git log
  23. # commit e73018f4843087bd3be23dbb469ffaec8d32ed1d (HEAD -> feature)
  24. # Author: vagrant <vagrant@localhost.localdomain>
  25. # Date: Thu Nov 9 03:28:32 2017 +0000
  26. #
  27. # Second commit.
  28. #
  29. # commit eb4173dbd9589057e4fa0df089de781b33db9f5c (master, develop)
  30. # Author: vagrant <vagrant@localhost.localdomain>
  31. # Date: Thu Nov 9 03:19:43 2017 +0000
  32. #
  33. # First commit.
  34.  
  35. git checkout develop
  36. git merge feature
  37. Updating eb4173d..e73018f
  38. # Fast-forward
  39. # a_file | 1 +
  40. # 1 file changed, 1 insertion(+)
  41.  
  42. git log
  43. # commit e73018f4843087bd3be23dbb469ffaec8d32ed1d (HEAD -> develop, feature)
  44. # Author: vagrant <vagrant@localhost.localdomain>
  45. # Date: Thu Nov 9 03:28:32 2017 +0000
  46. #
  47. # Second commit.
  48. #
  49. # commit eb4173dbd9589057e4fa0df089de781b33db9f5c (master)
  50. # Author: vagrant <vagrant@localhost.localdomain>
  51. # Date: Thu Nov 9 03:19:43 2017 +0000
  52. #
  53. # First commit.
  54.  
  55. # FAST FORWARD MERGE MEANS NO MERGE COMMIT SO HISTORIES ARE IDENTICAL.
  56.  
  57. git branch release
  58. git checkout release
  59. echo "Third commit." >> a_file
  60. git commit -am "Third commit."
  61. git checkout master
  62. git merge release
  63. # Fast-forward
  64. # a_file | 2 ++
  65. # 1 file changed, 2 insertions(+)
  66.  
  67. git log
  68. # commit a3db5c679d8106c2bc6b2c84680e6c594b6b53bd (HEAD -> master, release)
  69. # Author: vagrant <vagrant@localhost.localdomain>
  70. # Date: Thu Nov 9 03:35:23 2017 +0000
  71. #
  72. # Third commit.
  73. #
  74. # commit e73018f4843087bd3be23dbb469ffaec8d32ed1d (feature, develop)
  75. # Author: vagrant <vagrant@localhost.localdomain>
  76. # Date: Thu Nov 9 03:28:32 2017 +0000
  77. #
  78. # Second commit.
  79. #
  80. # commit eb4173dbd9589057e4fa0df089de781b33db9f5c
  81. # Author: vagrant <vagrant@localhost.localdomain>
  82. # Date: Thu Nov 9 03:19:43 2017 +0000
  83. #
  84. # First commit.
  85.  
  86. # ONCE AGAIN A FAST FORWARD MERGE SO NOT DIFFERENCE IN HISTORIES.
  87.  
  88. # BUT MEANWHILE DEVELOP HAS PROGRESSED.
  89. git checkout develop
  90. echo "Fourth commit." >> a_file
  91. git commit -am "Fourth commit."
  92. git merge master
  93. # Auto-merging a_file
  94. # CONFLICT (content): Merge conflict in a_file
  95. # Automatic merge failed; fix conflicts and then commit the result.
  96.  
  97. # MERGE CONFLICT BECAUSE SAME LINE WAS CHANGED.
  98. cat a_file
  99. # First commit.
  100. # Second commit.
  101. # <<<<<<< HEAD
  102. # Fourth commit.
  103. # =======
  104. # Third commit.
  105. # >>>>>>> master
  106.  
  107. # CURRENTLY ON DEVELOP SO 'HEAD' REPRESENTS CHANGED ON THAT BRANCH.
  108. # RESOLVE MERGE CONFLICTS...
  109. cat a_file
  110. # First commit.
  111. # Second commit.
  112. # Third commit.
  113. # Fourth commit.
  114. git commit -a
  115. git log
  116. # commit 761bf516a89ae8ff71c179b26d5bf8f5904e2c7b (HEAD -> develop)
  117. # Merge: a8080f0 a3db5c6
  118. # Author: vagrant <vagrant@localhost.localdomain>
  119. # Date: Thu Nov 9 03:45:40 2017 +0000
  120. #
  121. # Merge branch 'master' into develop
  122. #
  123. # commit a8080f05208451b8defc705ae153259cde415d68
  124. # Author: vagrant <vagrant@localhost.localdomain>
  125. # Date: Thu Nov 9 03:39:05 2017 +0000
  126. #
  127. # Fourth commit.
  128. #
  129. # commit a3db5c679d8106c2bc6b2c84680e6c594b6b53bd (release, master)
  130. # Author: vagrant <vagrant@localhost.localdomain>
  131. # Date: Thu Nov 9 03:35:23 2017 +0000
  132. #
  133. # Third commit.
  134. #
  135. # commit e73018f4843087bd3be23dbb469ffaec8d32ed1d (feature)
  136. # Author: vagrant <vagrant@localhost.localdomain>
  137. # Date: Thu Nov 9 03:28:32 2017 +0000
  138. #
  139. # Second commit.
  140. #
  141. # commit eb4173dbd9589057e4fa0df089de781b33db9f5c
  142. # Author: vagrant <vagrant@localhost.localdomain>
  143. # Date: Thu Nov 9 03:19:43 2017 +0000
  144. #
  145. # First commit.
  146.  
  147. # GIT LOG IS IN CORRECT ORDER BUT HISTORIES HAVE NOW DIVERGED BECAUSE DEVELOP HAS AN EXTRA 'MERGE COMMIT'.
  148.  
  149. # NOW MERGE BACK INTO MASTER.
  150. git branch release-two
  151. git checkout release-two
  152. echo "Fifth commit." >> a_file
  153. git commit -am "Fifth commit."
  154. git checkout master
  155. git merge release-two
  156. # Fast-forward
  157. # a_file | 2 ++
  158. # 1 file changed, 2 insertions(+)
  159.  
  160. # MEANWHILE ON DEVELOP FILE HAS CHANGED AGAIN BUT NOT THE SAME LINE THIS TIME.
  161. git checkout develop
  162. vim a_file
  163. cat a_file
  164. # 1st commit.
  165. # Second commit.
  166. # Third commit.
  167. # Fourth commit.
  168.  
  169. git commit -am "Sixth commit."
  170. git merge master
  171. # FILE OPENS FOR SAVING WITH MERGE COMMIT MESSAGE PRE-POPULATED. SAVE.
  172. # Auto-merging a_file
  173. # Merge made by the 'recursive' strategy.
  174. # a_file | 1 +
  175. # 1 file changed, 1 insertion(+)
  176.  
  177. # THIS TIME IT USED 'RECURSIVE' RATHER THAN 'FAST FORWARD' MERGE STRATEGY.
  178. git log
  179. # commit 007d58f791c1585a47a999bcdcc72262e89299f2 (HEAD -> develop)
  180. # Merge: 709a3cb f1825df
  181. # Author: vagrant <vagrant@localhost.localdomain>
  182. # Date: Thu Nov 9 03:55:44 2017 +0000
  183. #
  184. # Merge branch 'master' into develop
  185. #
  186. # commit 709a3cb6bd09dc6d12102c0813c1003b57fd332a
  187. # Author: vagrant <vagrant@localhost.localdomain>
  188. # Date: Thu Nov 9 03:55:12 2017 +0000
  189. #
  190. # Sixth commit.
  191. #
  192. # commit f1825df7011d7085c8b158ee55461b6f1780bca4 (release-two, master)
  193. # Author: vagrant <vagrant@localhost.localdomain>
  194. # Date: Thu Nov 9 03:52:25 2017 +0000
  195. #
  196. # Fifth commit.
  197. #
  198. # commit 761bf516a89ae8ff71c179b26d5bf8f5904e2c7b
  199. # Merge: a8080f0 a3db5c6
  200. # Author: vagrant <vagrant@localhost.localdomain>
  201. # Date: Thu Nov 9 03:45:40 2017 +0000
  202. #
  203. # Merge branch 'master' into develop
  204. #
  205. # commit a8080f05208451b8defc705ae153259cde415d68
  206. # Author: vagrant <vagrant@localhost.localdomain>
  207. # Date: Thu Nov 9 03:39:05 2017 +0000
  208. #
  209. # Fourth commit.
  210. #
  211. # commit a3db5c679d8106c2bc6b2c84680e6c594b6b53bd (release)
  212. # Author: vagrant <vagrant@localhost.localdomain>
  213. # Date: Thu Nov 9 03:35:23 2017 +0000
  214. #
  215. # Third commit.
  216. #
  217. # commit e73018f4843087bd3be23dbb469ffaec8d32ed1d (feature)
  218. # Author: vagrant <vagrant@localhost.localdomain>
  219. # Date: Thu Nov 9 03:28:32 2017 +0000
  220. #
  221. # Second commit.
  222. #
  223. # commit eb4173dbd9589057e4fa0df089de781b33db9f5c
  224. # Author: vagrant <vagrant@localhost.localdomain>
  225. # Date: Thu Nov 9 03:19:43 2017 +0000
  226. #
  227. # First commit.
  228.  
  229. # EVEN THOUGH THERE WERE NO MERGE CONFLICTS A NEW 'MERGE COMMIT' WAS STILL CREATED.
Add Comment
Please, Sign In to add comment