wayfarer 0.4.1 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (676) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +10 -0
  3. data/Gemfile.lock +15 -11
  4. data/docs/cookbook/batch_routing.md +22 -0
  5. data/docs/cookbook/consent_screen.md +36 -0
  6. data/docs/cookbook/executing_javascript.md +41 -0
  7. data/docs/cookbook/navigation.md +43 -0
  8. data/docs/cookbook/querying_html.md +3 -3
  9. data/docs/cookbook/screenshots.md +2 -2
  10. data/docs/guides/callbacks.md +5 -5
  11. data/docs/guides/debugging.md +17 -0
  12. data/docs/guides/error_handling.md +22 -26
  13. data/docs/guides/jobs.md +44 -18
  14. data/docs/guides/navigation.md +73 -0
  15. data/docs/guides/{browser_automation → networking}/capybara.md +9 -4
  16. data/docs/guides/{browser_automation → networking}/custom_adapters.md +0 -0
  17. data/docs/guides/{browser_automation → networking}/ferrum.md +3 -1
  18. data/docs/guides/networking/http.md +33 -0
  19. data/docs/guides/{browser_automation → networking}/selenium.md +4 -2
  20. data/docs/guides/pages.md +4 -4
  21. data/docs/guides/performance.md +108 -0
  22. data/docs/guides/reliability.md +41 -0
  23. data/docs/guides/routing/steering.md +30 -0
  24. data/docs/guides/tasks.md +9 -33
  25. data/docs/reference/api/base.md +13 -127
  26. data/docs/reference/api/route.md +1 -1
  27. data/docs/reference/cli.md +0 -78
  28. data/docs/reference/configuration_keys.md +1 -1
  29. data/lib/wayfarer/base.rb +37 -27
  30. data/lib/wayfarer/cli/base.rb +19 -1
  31. data/lib/wayfarer/cli/job.rb +5 -11
  32. data/lib/wayfarer/cli/route.rb +4 -2
  33. data/lib/wayfarer/cli/templates/job.rb.tt +3 -1
  34. data/lib/wayfarer/config/networking.rb +1 -1
  35. data/lib/wayfarer/config/struct.rb +1 -1
  36. data/lib/wayfarer/gc.rb +3 -4
  37. data/lib/wayfarer/handler.rb +15 -0
  38. data/lib/wayfarer/middleware/base.rb +19 -0
  39. data/lib/wayfarer/middleware/chain.rb +8 -0
  40. data/lib/wayfarer/middleware/controller.rb +40 -0
  41. data/lib/wayfarer/middleware/dedup.rb +5 -0
  42. data/lib/wayfarer/middleware/dispatch.rb +22 -0
  43. data/lib/wayfarer/middleware/fetch.rb +33 -13
  44. data/lib/wayfarer/middleware/lazy.rb +11 -0
  45. data/lib/wayfarer/middleware/normalize.rb +2 -0
  46. data/lib/wayfarer/middleware/router.rb +41 -3
  47. data/lib/wayfarer/middleware/stage.rb +6 -2
  48. data/lib/wayfarer/networking/context.rb +1 -0
  49. data/lib/wayfarer/networking/ferrum.rb +1 -0
  50. data/lib/wayfarer/networking/follow.rb +22 -0
  51. data/lib/wayfarer/networking/pool.rb +9 -8
  52. data/lib/wayfarer/networking/result.rb +0 -8
  53. data/lib/wayfarer/page.rb +1 -1
  54. data/lib/wayfarer/routing/matchers/custom.rb +2 -0
  55. data/lib/wayfarer/routing/matchers/host.rb +3 -1
  56. data/lib/wayfarer/routing/matchers/path.rb +2 -1
  57. data/lib/wayfarer/routing/result.rb +0 -5
  58. data/lib/wayfarer/routing/route.rb +6 -0
  59. data/lib/wayfarer/routing/router.rb +28 -0
  60. data/lib/wayfarer/serializer.rb +2 -2
  61. data/lib/wayfarer/stringify.rb +13 -7
  62. data/lib/wayfarer/task.rb +4 -2
  63. data/lib/wayfarer.rb +2 -7
  64. data/spec/base_spec.rb +33 -42
  65. data/spec/callbacks_spec.rb +2 -2
  66. data/spec/cli/job_spec.rb +9 -5
  67. data/spec/config/networking_spec.rb +2 -2
  68. data/spec/factories/{queue/middleware.rb → middleware.rb} +3 -3
  69. data/spec/factories/{queue/page.rb → page.rb} +3 -3
  70. data/spec/factories/{queue/task.rb → task.rb} +0 -0
  71. data/spec/fixtures/dummy_job.rb +1 -1
  72. data/spec/gc_spec.rb +5 -9
  73. data/spec/handler_spec.rb +11 -0
  74. data/spec/integration/callbacks_spec.rb +85 -0
  75. data/spec/integration/page_spec.rb +62 -0
  76. data/spec/integration/params_spec.rb +56 -0
  77. data/spec/integration/stage_spec.rb +51 -0
  78. data/spec/integration/steering_spec.rb +57 -0
  79. data/spec/middleware/chain_spec.rb +32 -19
  80. data/spec/middleware/controller_spec.rb +86 -0
  81. data/spec/middleware/dedup_spec.rb +20 -8
  82. data/spec/middleware/dispatch_spec.rb +43 -0
  83. data/spec/middleware/fetch_spec.rb +116 -45
  84. data/spec/middleware/normalize_spec.rb +5 -4
  85. data/spec/middleware/router_spec.rb +80 -28
  86. data/spec/middleware/stage_spec.rb +42 -19
  87. data/spec/networking/follow_spec.rb +41 -0
  88. data/spec/routing/router_spec.rb +24 -0
  89. data/spec/spec_helpers.rb +11 -3
  90. data/spec/support/static/git-scm.com/assets/application-38b0d42ff05ffea45841edebbd14b75b89585646153808e82907c2c5c11f324b.js +772 -0
  91. data/spec/support/static/git-scm.com/assets/application-cafcf280f67db0e6d8168ba98a38da878769a9d5f37793b68ffb963a02d185e0.css +1 -0
  92. data/spec/support/static/git-scm.com/assets/modernize-b3ebe0c31c24f230dc62179d3e1030d2e57a53b1668d9382c0a27dbd44a94beb.js +20 -0
  93. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-Bash.html +751 -0
  94. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-PowerShell.html +804 -0
  95. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-Sublime-Text.html +728 -0
  96. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-Visual-Studio-Code.html +751 -0
  97. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-Visual-Studio.html +740 -0
  98. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-Zsh.html +765 -0
  99. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Graphical-Interfaces.html +931 -0
  100. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Summary.html +702 -0
  101. data/spec/support/static/git-scm.com/book/en/v2/Appendix-B:-Embedding-Git-in-your-Applications-Command-line-Git.html +720 -0
  102. data/spec/support/static/git-scm.com/book/en/v2/Appendix-B:-Embedding-Git-in-your-Applications-Dulwich.html +746 -0
  103. data/spec/support/static/git-scm.com/book/en/v2/Appendix-B:-Embedding-Git-in-your-Applications-JGit.html +889 -0
  104. data/spec/support/static/git-scm.com/book/en/v2/Appendix-B:-Embedding-Git-in-your-Applications-Libgit2.html +1003 -0
  105. data/spec/support/static/git-scm.com/book/en/v2/Appendix-B:-Embedding-Git-in-your-Applications-go-git.html +792 -0
  106. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Administration.html +745 -0
  107. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Basic-Snapshotting.html +840 -0
  108. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Branching-and-Merging.html +829 -0
  109. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Debugging.html +731 -0
  110. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Email.html +766 -0
  111. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-External-Systems.html +721 -0
  112. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Getting-and-Creating-Projects.html +746 -0
  113. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Inspection-and-Comparison.html +735 -0
  114. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Patching.html +742 -0
  115. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Plumbing-Commands.html +715 -0
  116. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Setup-and-Config.html +863 -0
  117. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Sharing-and-Updating-Projects.html +802 -0
  118. data/spec/support/static/git-scm.com/book/en/v2/Customizing-Git-An-Example-Git-Enforced-Policy.html +1200 -0
  119. data/spec/support/static/git-scm.com/book/en/v2/Customizing-Git-Git-Attributes.html +1134 -0
  120. data/spec/support/static/git-scm.com/book/en/v2/Customizing-Git-Git-Configuration.html +1315 -0
  121. data/spec/support/static/git-scm.com/book/en/v2/Customizing-Git-Git-Hooks.html +876 -0
  122. data/spec/support/static/git-scm.com/book/en/v2/Customizing-Git-Summary.html +704 -0
  123. data/spec/support/static/git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project.html +1667 -0
  124. data/spec/support/static/git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows.html +859 -0
  125. data/spec/support/static/git-scm.com/book/en/v2/Distributed-Git-Maintaining-a-Project.html +1354 -0
  126. data/spec/support/static/git-scm.com/book/en/v2/Distributed-Git-Summary.html +704 -0
  127. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-A-Short-History-of-Git.html +735 -0
  128. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-About-Version-Control.html +783 -0
  129. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup.html +889 -0
  130. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-Getting-Help.html +750 -0
  131. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-Installing-Git.html +879 -0
  132. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-Summary.html +704 -0
  133. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-The-Command-Line.html +711 -0
  134. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-What-is-Git?.html +857 -0
  135. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository.html +816 -0
  136. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Git-Aliases.html +775 -0
  137. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository.html +1432 -0
  138. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Summary.html +703 -0
  139. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Tagging.html +1049 -0
  140. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Undoing-Things.html +998 -0
  141. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History.html +1172 -0
  142. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes.html +983 -0
  143. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging.html +1102 -0
  144. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Branch-Management.html +946 -0
  145. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell.html +1020 -0
  146. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Branching-Workflows.html +786 -0
  147. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Rebasing.html +1028 -0
  148. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Remote-Branches.html +1009 -0
  149. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Summary.html +705 -0
  150. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Environment-Variables.html +1009 -0
  151. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Git-Objects.html +1209 -0
  152. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Git-References.html +939 -0
  153. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery.html +1086 -0
  154. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Packfiles.html +876 -0
  155. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain.html +745 -0
  156. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Summary.html +708 -0
  157. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-The-Refspec.html +872 -0
  158. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols.html +1043 -0
  159. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Advanced-Merging.html +1605 -0
  160. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Bundling.html +888 -0
  161. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Credential-Storage.html +1035 -0
  162. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git.html +861 -0
  163. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Interactive-Staging.html +920 -0
  164. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Replace.html +949 -0
  165. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Rerere.html +983 -0
  166. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Reset-Demystified.html +1236 -0
  167. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Revision-Selection.html +1178 -0
  168. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Rewriting-History.html +1182 -0
  169. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Searching.html +875 -0
  170. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work.html +922 -0
  171. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Stashing-and-Cleaning.html +1039 -0
  172. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Submodules.html +1864 -0
  173. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Summary.html +705 -0
  174. data/spec/support/static/git-scm.com/book/en/v2/Git-and-Other-Systems-Git-as-a-Client.html +2656 -0
  175. data/spec/support/static/git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git.html +1741 -0
  176. data/spec/support/static/git-scm.com/book/en/v2/Git-and-Other-Systems-Summary.html +703 -0
  177. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key.html +759 -0
  178. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server.html +827 -0
  179. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Git-Daemon.html +775 -0
  180. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-GitLab.html +872 -0
  181. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-GitWeb.html +776 -0
  182. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server.html +870 -0
  183. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Smart-HTTP.html +789 -0
  184. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Summary.html +709 -0
  185. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols.html +963 -0
  186. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Third-Party-Hosted-Options.html +711 -0
  187. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Account-Setup-and-Configuration.html +858 -0
  188. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project.html +1502 -0
  189. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Maintaining-a-Project.html +1218 -0
  190. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Managing-an-organization.html +797 -0
  191. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Scripting-GitHub.html +1059 -0
  192. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Summary.html +704 -0
  193. data/spec/support/static/git-scm.com/book/en/v2/ch00/_abort_merge.html +1605 -0
  194. data/spec/support/static/git-scm.com/book/en/v2/ch00/_add_email_addresses.html +858 -0
  195. data/spec/support/static/git-scm.com/book/en/v2/ch00/_advanced_merging.html +1605 -0
  196. data/spec/support/static/git-scm.com/book/en/v2/ch00/_an_example_git_enforced_policy.html +1200 -0
  197. data/spec/support/static/git-scm.com/book/en/v2/ch00/_annotated_tags.html +1049 -0
  198. data/spec/support/static/git-scm.com/book/en/v2/ch00/_api_comment.html +1059 -0
  199. data/spec/support/static/git-scm.com/book/en/v2/ch00/_bare_repo.html +827 -0
  200. data/spec/support/static/git-scm.com/book/en/v2/ch00/_basic_branching.html +1102 -0
  201. data/spec/support/static/git-scm.com/book/en/v2/ch00/_basic_merge_conflicts.html +1102 -0
  202. data/spec/support/static/git-scm.com/book/en/v2/ch00/_basic_merging.html +1102 -0
  203. data/spec/support/static/git-scm.com/book/en/v2/ch00/_binary_search.html +861 -0
  204. data/spec/support/static/git-scm.com/book/en/v2/ch00/_branch_management.html +946 -0
  205. data/spec/support/static/git-scm.com/book/en/v2/ch00/_branch_references.html +1178 -0
  206. data/spec/support/static/git-scm.com/book/en/v2/ch00/_build_number.html +1354 -0
  207. data/spec/support/static/git-scm.com/book/en/v2/ch00/_bundling.html +888 -0
  208. data/spec/support/static/git-scm.com/book/en/v2/ch00/_changing_multiple.html +1182 -0
  209. data/spec/support/static/git-scm.com/book/en/v2/ch00/_checking_out_conflicts.html +1605 -0
  210. data/spec/support/static/git-scm.com/book/en/v2/ch00/_checking_out_remotes.html +1354 -0
  211. data/spec/support/static/git-scm.com/book/en/v2/ch00/_checking_status.html +1432 -0
  212. data/spec/support/static/git-scm.com/book/en/v2/ch00/_cloning_submodules.html +1864 -0
  213. data/spec/support/static/git-scm.com/book/en/v2/ch00/_commit_guidelines.html +1667 -0
  214. data/spec/support/static/git-scm.com/book/en/v2/ch00/_commit_ranges.html +1178 -0
  215. data/spec/support/static/git-scm.com/book/en/v2/ch00/_commit_status.html +1059 -0
  216. data/spec/support/static/git-scm.com/book/en/v2/ch00/_committing_changes.html +1432 -0
  217. data/spec/support/static/git-scm.com/book/en/v2/ch00/_contrib_file.html +1218 -0
  218. data/spec/support/static/git-scm.com/book/en/v2/ch00/_contributing_project.html +1667 -0
  219. data/spec/support/static/git-scm.com/book/en/v2/ch00/_create_new_branch.html +1020 -0
  220. data/spec/support/static/git-scm.com/book/en/v2/ch00/_credential_caching.html +1035 -0
  221. data/spec/support/static/git-scm.com/book/en/v2/ch00/_custom_importer.html +1741 -0
  222. data/spec/support/static/git-scm.com/book/en/v2/ch00/_data_recovery.html +1086 -0
  223. data/spec/support/static/git-scm.com/book/en/v2/ch00/_delete_branches.html +1009 -0
  224. data/spec/support/static/git-scm.com/book/en/v2/ch00/_editor.html +889 -0
  225. data/spec/support/static/git-scm.com/book/en/v2/ch00/_eg_task_lists.html +1502 -0
  226. data/spec/support/static/git-scm.com/book/en/v2/ch00/_email_hooks.html +876 -0
  227. data/spec/support/static/git-scm.com/book/en/v2/ch00/_email_notification.html +1502 -0
  228. data/spec/support/static/git-scm.com/book/en/v2/ch00/_email_notifications.html +1218 -0
  229. data/spec/support/static/git-scm.com/book/en/v2/ch00/_email_pr.html +1218 -0
  230. data/spec/support/static/git-scm.com/book/en/v2/ch00/_enforcing_commit_message_format.html +1200 -0
  231. data/spec/support/static/git-scm.com/book/en/v2/ch00/_example_markdown.html +1502 -0
  232. data/spec/support/static/git-scm.com/book/en/v2/ch00/_external_merge_tools.html +1315 -0
  233. data/spec/support/static/git-scm.com/book/en/v2/ch00/_fetch_and_push_on_different_repositories.html +1502 -0
  234. data/spec/support/static/git-scm.com/book/en/v2/ch00/_fetching_and_pulling.html +983 -0
  235. data/spec/support/static/git-scm.com/book/en/v2/ch00/_file_annotation.html +861 -0
  236. data/spec/support/static/git-scm.com/book/en/v2/ch00/_first_time.html +889 -0
  237. data/spec/support/static/git-scm.com/book/en/v2/ch00/_generate_ssh_key.html +759 -0
  238. data/spec/support/static/git-scm.com/book/en/v2/ch00/_getting_a_repo.html +816 -0
  239. data/spec/support/static/git-scm.com/book/en/v2/ch00/_getting_git_on_a_server.html +827 -0
  240. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_aliases.html +775 -0
  241. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_am.html +1354 -0
  242. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_amend.html +1182 -0
  243. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_branches_overview.html +1020 -0
  244. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_clean.html +1039 -0
  245. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_cloning.html +816 -0
  246. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_commit_objects.html +1209 -0
  247. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_config.html +1315 -0
  248. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_diff_staged.html +1432 -0
  249. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_gc.html +1086 -0
  250. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_grep.html +875 -0
  251. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_help.html +750 -0
  252. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_hooks.html +876 -0
  253. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_mv.html +1432 -0
  254. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_p4.html +1741 -0
  255. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_p4_branches.html +2656 -0
  256. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_reflog.html +1178 -0
  257. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_refs.html +939 -0
  258. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_reset.html +1236 -0
  259. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_stashing.html +1039 -0
  260. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_submodules.html +1864 -0
  261. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_svn.html +2656 -0
  262. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_tagging.html +1049 -0
  263. data/spec/support/static/git-scm.com/book/en/v2/ch00/_gitlab_groups_section.html +872 -0
  264. data/spec/support/static/git-scm.com/book/en/v2/ch00/_ignoring.html +1432 -0
  265. data/spec/support/static/git-scm.com/book/en/v2/ch00/_inspecting_remote.html +983 -0
  266. data/spec/support/static/git-scm.com/book/en/v2/ch00/_integration_manager.html +859 -0
  267. data/spec/support/static/git-scm.com/book/en/v2/ch00/_interactive_staging.html +920 -0
  268. data/spec/support/static/git-scm.com/book/en/v2/ch00/_keyword_expansion.html +1134 -0
  269. data/spec/support/static/git-scm.com/book/en/v2/ch00/_libgit2_bindings.html +1003 -0
  270. data/spec/support/static/git-scm.com/book/en/v2/ch00/_manual_remerge.html +1605 -0
  271. data/spec/support/static/git-scm.com/book/en/v2/ch00/_md_code.html +1502 -0
  272. data/spec/support/static/git-scm.com/book/en/v2/ch00/_md_drag.html +1502 -0
  273. data/spec/support/static/git-scm.com/book/en/v2/ch00/_md_emoji.html +1502 -0
  274. data/spec/support/static/git-scm.com/book/en/v2/ch00/_md_quote.html +1502 -0
  275. data/spec/support/static/git-scm.com/book/en/v2/ch00/_merge_button.html +1218 -0
  276. data/spec/support/static/git-scm.com/book/en/v2/ch00/_merge_log.html +1605 -0
  277. data/spec/support/static/git-scm.com/book/en/v2/ch00/_merge_rebase_work.html +1028 -0
  278. data/spec/support/static/git-scm.com/book/en/v2/ch00/_new_repo_dropdown.html +1218 -0
  279. data/spec/support/static/git-scm.com/book/en/v2/ch00/_not_center.html +1218 -0
  280. data/spec/support/static/git-scm.com/book/en/v2/ch00/_org_page.html +797 -0
  281. data/spec/support/static/git-scm.com/book/en/v2/ch00/_other_client_hooks.html +876 -0
  282. data/spec/support/static/git-scm.com/book/en/v2/ch00/_p4_git_fusion.html +2656 -0
  283. data/spec/support/static/git-scm.com/book/en/v2/ch00/_patches_from_email.html +1354 -0
  284. data/spec/support/static/git-scm.com/book/en/v2/ch00/_personal_avatar.html +858 -0
  285. data/spec/support/static/git-scm.com/book/en/v2/ch00/_plumbing_porcelain.html +745 -0
  286. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_closed.html +1502 -0
  287. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_discussion.html +1502 -0
  288. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_fail.html +1502 -0
  289. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_final.html +1502 -0
  290. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_references.html +1502 -0
  291. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_references_render.html +1502 -0
  292. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_refs.html +1218 -0
  293. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pre_merge_rebase_work.html +1028 -0
  294. data/spec/support/static/git-scm.com/book/en/v2/ch00/_preparing_release.html +1354 -0
  295. data/spec/support/static/git-scm.com/book/en/v2/ch00/_private_team.html +1667 -0
  296. data/spec/support/static/git-scm.com/book/en/v2/ch00/_project_over_email.html +1667 -0
  297. data/spec/support/static/git-scm.com/book/en/v2/ch00/_public_project.html +1667 -0
  298. data/spec/support/static/git-scm.com/book/en/v2/ch00/_publishing_submodules.html +1864 -0
  299. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pushing_branches.html +1009 -0
  300. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pushing_refspecs.html +872 -0
  301. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pushing_remotes.html +983 -0
  302. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rebase_cherry_pick.html +1354 -0
  303. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rebase_peril.html +1028 -0
  304. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rebase_rebase.html +1028 -0
  305. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rebase_rebase_work.html +1028 -0
  306. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rebasing.html +1028 -0
  307. data/spec/support/static/git-scm.com/book/en/v2/ch00/_refspec.html +872 -0
  308. data/spec/support/static/git-scm.com/book/en/v2/ch00/_remote_branches.html +1009 -0
  309. data/spec/support/static/git-scm.com/book/en/v2/ch00/_remote_repos.html +983 -0
  310. data/spec/support/static/git-scm.com/book/en/v2/ch00/_removing_file_every_commit.html +1182 -0
  311. data/spec/support/static/git-scm.com/book/en/v2/ch00/_removing_files.html +1432 -0
  312. data/spec/support/static/git-scm.com/book/en/v2/ch00/_removing_objects.html +1086 -0
  313. data/spec/support/static/git-scm.com/book/en/v2/ch00/_replace.html +949 -0
  314. data/spec/support/static/git-scm.com/book/en/v2/ch00/_reverse_commit.html +1605 -0
  315. data/spec/support/static/git-scm.com/book/en/v2/ch00/_revision_selection.html +1178 -0
  316. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rewriting_history.html +1182 -0
  317. data/spec/support/static/git-scm.com/book/en/v2/ch00/_searching.html +875 -0
  318. data/spec/support/static/git-scm.com/book/en/v2/ch00/_service_config.html +1059 -0
  319. data/spec/support/static/git-scm.com/book/en/v2/ch00/_services_hooks.html +1059 -0
  320. data/spec/support/static/git-scm.com/book/en/v2/ch00/_setting_up_server.html +870 -0
  321. data/spec/support/static/git-scm.com/book/en/v2/ch00/_sharing_tags.html +1049 -0
  322. data/spec/support/static/git-scm.com/book/en/v2/ch00/_signing.html +922 -0
  323. data/spec/support/static/git-scm.com/book/en/v2/ch00/_signing_commits.html +922 -0
  324. data/spec/support/static/git-scm.com/book/en/v2/ch00/_squashing.html +1182 -0
  325. data/spec/support/static/git-scm.com/book/en/v2/ch00/_starting_submodules.html +1864 -0
  326. data/spec/support/static/git-scm.com/book/en/v2/ch00/_subtree_merge.html +1605 -0
  327. data/spec/support/static/git-scm.com/book/en/v2/ch00/_switching_branches.html +1020 -0
  328. data/spec/support/static/git-scm.com/book/en/v2/ch00/_tagging_releases.html +1354 -0
  329. data/spec/support/static/git-scm.com/book/en/v2/ch00/_task_list_progress.html +1502 -0
  330. data/spec/support/static/git-scm.com/book/en/v2/ch00/_team_page.html +797 -0
  331. data/spec/support/static/git-scm.com/book/en/v2/ch00/_the_index.html +1236 -0
  332. data/spec/support/static/git-scm.com/book/en/v2/ch00/_the_shortlog.html +1354 -0
  333. data/spec/support/static/git-scm.com/book/en/v2/ch00/_topic_branch.html +786 -0
  334. data/spec/support/static/git-scm.com/book/en/v2/ch00/_tracking_branches.html +1009 -0
  335. data/spec/support/static/git-scm.com/book/en/v2/ch00/_tracking_files.html +1432 -0
  336. data/spec/support/static/git-scm.com/book/en/v2/ch00/_tree_objects.html +1209 -0
  337. data/spec/support/static/git-scm.com/book/en/v2/ch00/_triple_dot.html +1178 -0
  338. data/spec/support/static/git-scm.com/book/en/v2/ch00/_undoing.html +998 -0
  339. data/spec/support/static/git-scm.com/book/en/v2/ch00/_unstaging.html +998 -0
  340. data/spec/support/static/git-scm.com/book/en/v2/ch00/_viewing_history.html +1172 -0
  341. data/spec/support/static/git-scm.com/book/en/v2/ch00/_web_hook.html +1059 -0
  342. data/spec/support/static/git-scm.com/book/en/v2/ch00/_what_is_introduced.html +1354 -0
  343. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch01-getting-started.html +783 -0
  344. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch02-git-basics-chapter.html +816 -0
  345. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch03-git-branching.html +1020 -0
  346. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch05-distributed-git.html +859 -0
  347. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch06-github.html +858 -0
  348. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch06-github_flow.html +1502 -0
  349. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch10-git-internals.html +745 -0
  350. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch_core_editor.html +863 -0
  351. data/spec/support/static/git-scm.com/book/en/v2/ch00/divergent_history.html +1020 -0
  352. data/spec/support/static/git-scm.com/book/en/v2/ch00/double_dot.html +1178 -0
  353. data/spec/support/static/git-scm.com/book/en/v2/ch00/filters_a.html +1134 -0
  354. data/spec/support/static/git-scm.com/book/en/v2/ch00/filters_b.html +1134 -0
  355. data/spec/support/static/git-scm.com/book/en/v2/ch00/limit_options.html +1172 -0
  356. data/spec/support/static/git-scm.com/book/en/v2/ch00/log_options.html +1172 -0
  357. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_a.html +1354 -0
  358. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_b.html +1354 -0
  359. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_c.html +1354 -0
  360. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_d.html +1354 -0
  361. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_e.html +1354 -0
  362. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_f.html +1354 -0
  363. data/spec/support/static/git-scm.com/book/en/v2/ch00/oh_my_zsh_git.html +765 -0
  364. data/spec/support/static/git-scm.com/book/en/v2/ch00/pretty_format.html +1172 -0
  365. data/spec/support/static/git-scm.com/book/en/v2/ch00/psp_b.html +1667 -0
  366. data/spec/support/static/git-scm.com/book/en/v2/ch00/rbdiag_e.html +1028 -0
  367. data/spec/support/static/git-scm.com/book/en/v2/ch00/rbdiag_g.html +1028 -0
  368. data/spec/support/static/git-scm.com/book/en/v2/ch00/rbdiag_h.html +1028 -0
  369. data/spec/support/static/git-scm.com/book/en/v2/ch00/rbdiag_i.html +1028 -0
  370. data/spec/support/static/git-scm.com/book/en/v2/ch00/rebasing-merging-example.html +1028 -0
  371. data/spec/support/static/git-scm.com/book/en/v2/ch00/ref_rerere.html +983 -0
  372. data/spec/support/static/git-scm.com/book/en/v2/ch00/ref_the_ref.html +939 -0
  373. data/spec/support/static/git-scm.com/book/en/v2/ch00/wfdiag_b.html +859 -0
  374. data/spec/support/static/git-scm.com/book/en/v2/ch00/wfdiag_c.html +859 -0
  375. data/spec/support/static/git-scm.com/book/en/v2/ch00/what_is_git_section.html +857 -0
  376. data/spec/support/static/git-scm.com/book/en/v2/images/2fa-1.png +0 -0
  377. data/spec/support/static/git-scm.com/book/en/v2/images/account-settings.png +0 -0
  378. data/spec/support/static/git-scm.com/book/en/v2/images/advance-master.png +0 -0
  379. data/spec/support/static/git-scm.com/book/en/v2/images/advance-testing.png +0 -0
  380. data/spec/support/static/git-scm.com/book/en/v2/images/areas.png +0 -0
  381. data/spec/support/static/git-scm.com/book/en/v2/images/avatar-crop.png +0 -0
  382. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-1.png +0 -0
  383. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-2.png +0 -0
  384. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-3.png +0 -0
  385. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-4.png +0 -0
  386. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-5.png +0 -0
  387. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-6.png +0 -0
  388. data/spec/support/static/git-scm.com/book/en/v2/images/basic-merging-1.png +0 -0
  389. data/spec/support/static/git-scm.com/book/en/v2/images/basic-merging-2.png +0 -0
  390. data/spec/support/static/git-scm.com/book/en/v2/images/basic-rebase-1.png +0 -0
  391. data/spec/support/static/git-scm.com/book/en/v2/images/basic-rebase-2.png +0 -0
  392. data/spec/support/static/git-scm.com/book/en/v2/images/basic-rebase-3.png +0 -0
  393. data/spec/support/static/git-scm.com/book/en/v2/images/basic-rebase-4.png +0 -0
  394. data/spec/support/static/git-scm.com/book/en/v2/images/benevolent-dictator.png +0 -0
  395. data/spec/support/static/git-scm.com/book/en/v2/images/blink-01-start.png +0 -0
  396. data/spec/support/static/git-scm.com/book/en/v2/images/blink-02-pr.png +0 -0
  397. data/spec/support/static/git-scm.com/book/en/v2/images/blink-03-pull-request-open.png +0 -0
  398. data/spec/support/static/git-scm.com/book/en/v2/images/blink-04-email.png +0 -0
  399. data/spec/support/static/git-scm.com/book/en/v2/images/blink-04-pr-comment.png +0 -0
  400. data/spec/support/static/git-scm.com/book/en/v2/images/blink-05-general-comment.png +0 -0
  401. data/spec/support/static/git-scm.com/book/en/v2/images/blink-06-final.png +0 -0
  402. data/spec/support/static/git-scm.com/book/en/v2/images/branch-and-history.png +0 -0
  403. data/spec/support/static/git-scm.com/book/en/v2/images/branch_widget_mac.png +0 -0
  404. data/spec/support/static/git-scm.com/book/en/v2/images/branch_widget_win.png +0 -0
  405. data/spec/support/static/git-scm.com/book/en/v2/images/centralized.png +0 -0
  406. data/spec/support/static/git-scm.com/book/en/v2/images/centralized_workflow.png +0 -0
  407. data/spec/support/static/git-scm.com/book/en/v2/images/checkout-master.png +0 -0
  408. data/spec/support/static/git-scm.com/book/en/v2/images/clean.png +0 -0
  409. data/spec/support/static/git-scm.com/book/en/v2/images/collaborators.png +0 -0
  410. data/spec/support/static/git-scm.com/book/en/v2/images/commit-and-tree.png +0 -0
  411. data/spec/support/static/git-scm.com/book/en/v2/images/commits-and-parents.png +0 -0
  412. data/spec/support/static/git-scm.com/book/en/v2/images/data-model-1.png +0 -0
  413. data/spec/support/static/git-scm.com/book/en/v2/images/data-model-2.png +0 -0
  414. data/spec/support/static/git-scm.com/book/en/v2/images/data-model-3.png +0 -0
  415. data/spec/support/static/git-scm.com/book/en/v2/images/data-model-4.png +0 -0
  416. data/spec/support/static/git-scm.com/book/en/v2/images/deltas.png +0 -0
  417. data/spec/support/static/git-scm.com/book/en/v2/images/distributed.png +0 -0
  418. data/spec/support/static/git-scm.com/book/en/v2/images/double-dot.png +0 -0
  419. data/spec/support/static/git-scm.com/book/en/v2/images/email-settings.png +0 -0
  420. data/spec/support/static/git-scm.com/book/en/v2/images/forkbutton.png +0 -0
  421. data/spec/support/static/git-scm.com/book/en/v2/images/git-bash.png +0 -0
  422. data/spec/support/static/git-scm.com/book/en/v2/images/git-diff-check.png +0 -0
  423. data/spec/support/static/git-scm.com/book/en/v2/images/git-fusion-boot.png +0 -0
  424. data/spec/support/static/git-scm.com/book/en/v2/images/git-fusion-perforce-graph.png +0 -0
  425. data/spec/support/static/git-scm.com/book/en/v2/images/git-gui.png +0 -0
  426. data/spec/support/static/git-scm.com/book/en/v2/images/git-instaweb.png +0 -0
  427. data/spec/support/static/git-scm.com/book/en/v2/images/git-osx-installer.png +0 -0
  428. data/spec/support/static/git-scm.com/book/en/v2/images/github_mac.png +0 -0
  429. data/spec/support/static/git-scm.com/book/en/v2/images/github_win.png +0 -0
  430. data/spec/support/static/git-scm.com/book/en/v2/images/gitk.png +0 -0
  431. data/spec/support/static/git-scm.com/book/en/v2/images/gitlab-groups.png +0 -0
  432. data/spec/support/static/git-scm.com/book/en/v2/images/gitlab-menu.png +0 -0
  433. data/spec/support/static/git-scm.com/book/en/v2/images/gitlab-users.png +0 -0
  434. data/spec/support/static/git-scm.com/book/en/v2/images/head-to-master.png +0 -0
  435. data/spec/support/static/git-scm.com/book/en/v2/images/head-to-testing.png +0 -0
  436. data/spec/support/static/git-scm.com/book/en/v2/images/integration-manager.png +0 -0
  437. data/spec/support/static/git-scm.com/book/en/v2/images/interesting-rebase-1.png +0 -0
  438. data/spec/support/static/git-scm.com/book/en/v2/images/interesting-rebase-2.png +0 -0
  439. data/spec/support/static/git-scm.com/book/en/v2/images/interesting-rebase-3.png +0 -0
  440. data/spec/support/static/git-scm.com/book/en/v2/images/interesting-rebase-4.png +0 -0
  441. data/spec/support/static/git-scm.com/book/en/v2/images/interesting-rebase-5.png +0 -0
  442. data/spec/support/static/git-scm.com/book/en/v2/images/jb.png +0 -0
  443. data/spec/support/static/git-scm.com/book/en/v2/images/large-merges-1.png +0 -0
  444. data/spec/support/static/git-scm.com/book/en/v2/images/large-merges-2.png +0 -0
  445. data/spec/support/static/git-scm.com/book/en/v2/images/lifecycle.png +0 -0
  446. data/spec/support/static/git-scm.com/book/en/v2/images/local.png +0 -0
  447. data/spec/support/static/git-scm.com/book/en/v2/images/lr-branches-1.png +0 -0
  448. data/spec/support/static/git-scm.com/book/en/v2/images/lr-branches-2.png +0 -0
  449. data/spec/support/static/git-scm.com/book/en/v2/images/maint-01-email.png +0 -0
  450. data/spec/support/static/git-scm.com/book/en/v2/images/maint-02-merge.png +0 -0
  451. data/spec/support/static/git-scm.com/book/en/v2/images/maint-03-email-resp.png +0 -0
  452. data/spec/support/static/git-scm.com/book/en/v2/images/maint-04-target.png +0 -0
  453. data/spec/support/static/git-scm.com/book/en/v2/images/maint-05-mentions.png +0 -0
  454. data/spec/support/static/git-scm.com/book/en/v2/images/maint-06-unsubscribe.png +0 -0
  455. data/spec/support/static/git-scm.com/book/en/v2/images/maint-07-notifications.png +0 -0
  456. data/spec/support/static/git-scm.com/book/en/v2/images/maint-08-notifications-page.png +0 -0
  457. data/spec/support/static/git-scm.com/book/en/v2/images/maint-09-contrib.png +0 -0
  458. data/spec/support/static/git-scm.com/book/en/v2/images/maint-10-default-branch.png +0 -0
  459. data/spec/support/static/git-scm.com/book/en/v2/images/maint-11-transfer.png +0 -0
  460. data/spec/support/static/git-scm.com/book/en/v2/images/managed-team-1.png +0 -0
  461. data/spec/support/static/git-scm.com/book/en/v2/images/managed-team-2.png +0 -0
  462. data/spec/support/static/git-scm.com/book/en/v2/images/managed-team-3.png +0 -0
  463. data/spec/support/static/git-scm.com/book/en/v2/images/managed-team-flow.png +0 -0
  464. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-01-example.png +0 -0
  465. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-02-tasks.png +0 -0
  466. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-03-task-summary.png +0 -0
  467. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-04-fenced-code.png +0 -0
  468. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-05-quote.png +0 -0
  469. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-06-emoji-complete.png +0 -0
  470. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-07-emoji.png +0 -0
  471. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-08-drag-drop.png +0 -0
  472. data/spec/support/static/git-scm.com/book/en/v2/images/mentions-01-syntax.png +0 -0
  473. data/spec/support/static/git-scm.com/book/en/v2/images/mentions-02-render.png +0 -0
  474. data/spec/support/static/git-scm.com/book/en/v2/images/mentions-03-closed.png +0 -0
  475. data/spec/support/static/git-scm.com/book/en/v2/images/merging-workflows-1.png +0 -0
  476. data/spec/support/static/git-scm.com/book/en/v2/images/merging-workflows-2.png +0 -0
  477. data/spec/support/static/git-scm.com/book/en/v2/images/merging-workflows-3.png +0 -0
  478. data/spec/support/static/git-scm.com/book/en/v2/images/merging-workflows-4.png +0 -0
  479. data/spec/support/static/git-scm.com/book/en/v2/images/merging-workflows-5.png +0 -0
  480. data/spec/support/static/git-scm.com/book/en/v2/images/new-repo.png +0 -0
  481. data/spec/support/static/git-scm.com/book/en/v2/images/neworg.png +0 -0
  482. data/spec/support/static/git-scm.com/book/en/v2/images/newrepo.png +0 -0
  483. data/spec/support/static/git-scm.com/book/en/v2/images/newrepoform.png +0 -0
  484. data/spec/support/static/git-scm.com/book/en/v2/images/orgs-01-page.png +0 -0
  485. data/spec/support/static/git-scm.com/book/en/v2/images/orgs-02-teams.png +0 -0
  486. data/spec/support/static/git-scm.com/book/en/v2/images/orgs-03-audit.png +0 -0
  487. data/spec/support/static/git-scm.com/book/en/v2/images/p4merge.png +0 -0
  488. data/spec/support/static/git-scm.com/book/en/v2/images/perils-of-rebasing-1.png +0 -0
  489. data/spec/support/static/git-scm.com/book/en/v2/images/perils-of-rebasing-2.png +0 -0
  490. data/spec/support/static/git-scm.com/book/en/v2/images/perils-of-rebasing-3.png +0 -0
  491. data/spec/support/static/git-scm.com/book/en/v2/images/perils-of-rebasing-4.png +0 -0
  492. data/spec/support/static/git-scm.com/book/en/v2/images/perils-of-rebasing-5.png +0 -0
  493. data/spec/support/static/git-scm.com/book/en/v2/images/posh-git.png +0 -0
  494. data/spec/support/static/git-scm.com/book/en/v2/images/pr-01-fail.png +0 -0
  495. data/spec/support/static/git-scm.com/book/en/v2/images/pr-02-merge-fix.png +0 -0
  496. data/spec/support/static/git-scm.com/book/en/v2/images/public-small-1.png +0 -0
  497. data/spec/support/static/git-scm.com/book/en/v2/images/public-small-2.png +0 -0
  498. data/spec/support/static/git-scm.com/book/en/v2/images/public-small-3.png +0 -0
  499. data/spec/support/static/git-scm.com/book/en/v2/images/rebasing-1.png +0 -0
  500. data/spec/support/static/git-scm.com/book/en/v2/images/rebasing-2.png +0 -0
  501. data/spec/support/static/git-scm.com/book/en/v2/images/remote-branches-1.png +0 -0
  502. data/spec/support/static/git-scm.com/book/en/v2/images/remote-branches-2.png +0 -0
  503. data/spec/support/static/git-scm.com/book/en/v2/images/remote-branches-3.png +0 -0
  504. data/spec/support/static/git-scm.com/book/en/v2/images/remote-branches-4.png +0 -0
  505. data/spec/support/static/git-scm.com/book/en/v2/images/remote-branches-5.png +0 -0
  506. data/spec/support/static/git-scm.com/book/en/v2/images/replace1.png +0 -0
  507. data/spec/support/static/git-scm.com/book/en/v2/images/replace2.png +0 -0
  508. data/spec/support/static/git-scm.com/book/en/v2/images/replace3.png +0 -0
  509. data/spec/support/static/git-scm.com/book/en/v2/images/replace4.png +0 -0
  510. data/spec/support/static/git-scm.com/book/en/v2/images/replace5.png +0 -0
  511. data/spec/support/static/git-scm.com/book/en/v2/images/reposettingslink.png +0 -0
  512. data/spec/support/static/git-scm.com/book/en/v2/images/rerere1.png +0 -0
  513. data/spec/support/static/git-scm.com/book/en/v2/images/rerere2.png +0 -0
  514. data/spec/support/static/git-scm.com/book/en/v2/images/rerere3.png +0 -0
  515. data/spec/support/static/git-scm.com/book/en/v2/images/reset-checkout.png +0 -0
  516. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex1.png +0 -0
  517. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex2.png +0 -0
  518. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex3.png +0 -0
  519. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex4.png +0 -0
  520. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex5.png +0 -0
  521. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex6.png +0 -0
  522. data/spec/support/static/git-scm.com/book/en/v2/images/reset-hard.png +0 -0
  523. data/spec/support/static/git-scm.com/book/en/v2/images/reset-mixed.png +0 -0
  524. data/spec/support/static/git-scm.com/book/en/v2/images/reset-path1.png +0 -0
  525. data/spec/support/static/git-scm.com/book/en/v2/images/reset-path2.png +0 -0
  526. data/spec/support/static/git-scm.com/book/en/v2/images/reset-path3.png +0 -0
  527. data/spec/support/static/git-scm.com/book/en/v2/images/reset-soft.png +0 -0
  528. data/spec/support/static/git-scm.com/book/en/v2/images/reset-squash-r1.png +0 -0
  529. data/spec/support/static/git-scm.com/book/en/v2/images/reset-squash-r2.png +0 -0
  530. data/spec/support/static/git-scm.com/book/en/v2/images/reset-squash-r3.png +0 -0
  531. data/spec/support/static/git-scm.com/book/en/v2/images/reset-start.png +0 -0
  532. data/spec/support/static/git-scm.com/book/en/v2/images/reset-workflow.png +0 -0
  533. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-01-services.png +0 -0
  534. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-02-email-service.png +0 -0
  535. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-03-webhook.png +0 -0
  536. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-04-webhook-debug.png +0 -0
  537. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-05-access-token.png +0 -0
  538. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-06-comment.png +0 -0
  539. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-07-status.png +0 -0
  540. data/spec/support/static/git-scm.com/book/en/v2/images/signup.png +0 -0
  541. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-1.png +0 -0
  542. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-2.png +0 -0
  543. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-3.png +0 -0
  544. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-4.png +0 -0
  545. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-5.png +0 -0
  546. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-6.png +0 -0
  547. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-7.png +0 -0
  548. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-flow.png +0 -0
  549. data/spec/support/static/git-scm.com/book/en/v2/images/smudge.png +0 -0
  550. data/spec/support/static/git-scm.com/book/en/v2/images/snapshots.png +0 -0
  551. data/spec/support/static/git-scm.com/book/en/v2/images/ssh-keys.png +0 -0
  552. data/spec/support/static/git-scm.com/book/en/v2/images/topic-branches-1.png +0 -0
  553. data/spec/support/static/git-scm.com/book/en/v2/images/topic-branches-2.png +0 -0
  554. data/spec/support/static/git-scm.com/book/en/v2/images/two-branches.png +0 -0
  555. data/spec/support/static/git-scm.com/book/en/v2/images/undomerge-reset.png +0 -0
  556. data/spec/support/static/git-scm.com/book/en/v2/images/undomerge-revert.png +0 -0
  557. data/spec/support/static/git-scm.com/book/en/v2/images/undomerge-revert2.png +0 -0
  558. data/spec/support/static/git-scm.com/book/en/v2/images/undomerge-revert3.png +0 -0
  559. data/spec/support/static/git-scm.com/book/en/v2/images/undomerge-start.png +0 -0
  560. data/spec/support/static/git-scm.com/book/en/v2/images/your-profile.png +0 -0
  561. data/spec/support/static/git-scm.com/book/en/v2/images/zsh-oh-my.png +0 -0
  562. data/spec/support/static/git-scm.com/book/en/v2/images/zsh-prompt.png +0 -0
  563. data/spec/support/static/git-scm.com/book/en/v2.html +688 -0
  564. data/spec/support/static/git-scm.com/favicon.ico +0 -0
  565. data/spec/support/static/git-scm.com/images/bg/body.jpg +0 -0
  566. data/spec/support/static/git-scm.com/images/bg/isometric-grid.png +0 -0
  567. data/spec/support/static/git-scm.com/images/bg/isometric-grid@2x.png +0 -0
  568. data/spec/support/static/git-scm.com/images/bg/search-header.jpg +0 -0
  569. data/spec/support/static/git-scm.com/images/company-project-logos/android.png +0 -0
  570. data/spec/support/static/git-scm.com/images/company-project-logos/android@2x.png +0 -0
  571. data/spec/support/static/git-scm.com/images/company-project-logos/eclipse.png +0 -0
  572. data/spec/support/static/git-scm.com/images/company-project-logos/eclipse@2x.png +0 -0
  573. data/spec/support/static/git-scm.com/images/company-project-logos/facebook.png +0 -0
  574. data/spec/support/static/git-scm.com/images/company-project-logos/facebook@2x.png +0 -0
  575. data/spec/support/static/git-scm.com/images/company-project-logos/gnome.png +0 -0
  576. data/spec/support/static/git-scm.com/images/company-project-logos/gnome@2x.png +0 -0
  577. data/spec/support/static/git-scm.com/images/company-project-logos/google.png +0 -0
  578. data/spec/support/static/git-scm.com/images/company-project-logos/google@2x.png +0 -0
  579. data/spec/support/static/git-scm.com/images/company-project-logos/kde.png +0 -0
  580. data/spec/support/static/git-scm.com/images/company-project-logos/kde@2x.png +0 -0
  581. data/spec/support/static/git-scm.com/images/company-project-logos/linked-in.png +0 -0
  582. data/spec/support/static/git-scm.com/images/company-project-logos/linked-in@2x.png +0 -0
  583. data/spec/support/static/git-scm.com/images/company-project-logos/linux.png +0 -0
  584. data/spec/support/static/git-scm.com/images/company-project-logos/linux@2x.png +0 -0
  585. data/spec/support/static/git-scm.com/images/company-project-logos/microsoft.png +0 -0
  586. data/spec/support/static/git-scm.com/images/company-project-logos/microsoft@2x.png +0 -0
  587. data/spec/support/static/git-scm.com/images/company-project-logos/netflix.png +0 -0
  588. data/spec/support/static/git-scm.com/images/company-project-logos/netflix@2x.png +0 -0
  589. data/spec/support/static/git-scm.com/images/company-project-logos/perl.png +0 -0
  590. data/spec/support/static/git-scm.com/images/company-project-logos/perl@2x.png +0 -0
  591. data/spec/support/static/git-scm.com/images/company-project-logos/postgresql.png +0 -0
  592. data/spec/support/static/git-scm.com/images/company-project-logos/postgresql@2x.png +0 -0
  593. data/spec/support/static/git-scm.com/images/company-project-logos/qt.png +0 -0
  594. data/spec/support/static/git-scm.com/images/company-project-logos/qt@2x.png +0 -0
  595. data/spec/support/static/git-scm.com/images/company-project-logos/rails.png +0 -0
  596. data/spec/support/static/git-scm.com/images/company-project-logos/rails@2x.png +0 -0
  597. data/spec/support/static/git-scm.com/images/company-project-logos/twitter.png +0 -0
  598. data/spec/support/static/git-scm.com/images/company-project-logos/twitter@2x.png +0 -0
  599. data/spec/support/static/git-scm.com/images/company-project-logos/x.png +0 -0
  600. data/spec/support/static/git-scm.com/images/company-project-logos/x@2x.png +0 -0
  601. data/spec/support/static/git-scm.com/images/epub.png +0 -0
  602. data/spec/support/static/git-scm.com/images/icons/admin-sm.png +0 -0
  603. data/spec/support/static/git-scm.com/images/icons/admin-sm@2x.png +0 -0
  604. data/spec/support/static/git-scm.com/images/icons/apple.png +0 -0
  605. data/spec/support/static/git-scm.com/images/icons/apple@2x.png +0 -0
  606. data/spec/support/static/git-scm.com/images/icons/book.png +0 -0
  607. data/spec/support/static/git-scm.com/images/icons/book@2x.png +0 -0
  608. data/spec/support/static/git-scm.com/images/icons/box.png +0 -0
  609. data/spec/support/static/git-scm.com/images/icons/box@2x.png +0 -0
  610. data/spec/support/static/git-scm.com/images/icons/branch-sm.png +0 -0
  611. data/spec/support/static/git-scm.com/images/icons/branch-sm@2x.png +0 -0
  612. data/spec/support/static/git-scm.com/images/icons/camera-sm.png +0 -0
  613. data/spec/support/static/git-scm.com/images/icons/camera-sm@2x.png +0 -0
  614. data/spec/support/static/git-scm.com/images/icons/chevron-up@2x.png +0 -0
  615. data/spec/support/static/git-scm.com/images/icons/code.png +0 -0
  616. data/spec/support/static/git-scm.com/images/icons/code@2x.png +0 -0
  617. data/spec/support/static/git-scm.com/images/icons/debugging-sm.png +0 -0
  618. data/spec/support/static/git-scm.com/images/icons/debugging-sm@2x.png +0 -0
  619. data/spec/support/static/git-scm.com/images/icons/document.png +0 -0
  620. data/spec/support/static/git-scm.com/images/icons/document@2x.png +0 -0
  621. data/spec/support/static/git-scm.com/images/icons/download.png +0 -0
  622. data/spec/support/static/git-scm.com/images/icons/email-sm.png +0 -0
  623. data/spec/support/static/git-scm.com/images/icons/email-sm@2x.png +0 -0
  624. data/spec/support/static/git-scm.com/images/icons/external-sm.png +0 -0
  625. data/spec/support/static/git-scm.com/images/icons/external-sm@2x.png +0 -0
  626. data/spec/support/static/git-scm.com/images/icons/gui.png +0 -0
  627. data/spec/support/static/git-scm.com/images/icons/gui@2x.png +0 -0
  628. data/spec/support/static/git-scm.com/images/icons/info.png +0 -0
  629. data/spec/support/static/git-scm.com/images/icons/info@2x.png +0 -0
  630. data/spec/support/static/git-scm.com/images/icons/inspection-sm.png +0 -0
  631. data/spec/support/static/git-scm.com/images/icons/inspection-sm@2x.png +0 -0
  632. data/spec/support/static/git-scm.com/images/icons/linux.png +0 -0
  633. data/spec/support/static/git-scm.com/images/icons/linux@2x.png +0 -0
  634. data/spec/support/static/git-scm.com/images/icons/nav-circles.png +0 -0
  635. data/spec/support/static/git-scm.com/images/icons/nav-circles@2x.png +0 -0
  636. data/spec/support/static/git-scm.com/images/icons/patching-sm.png +0 -0
  637. data/spec/support/static/git-scm.com/images/icons/patching-sm@2x.png +0 -0
  638. data/spec/support/static/git-scm.com/images/icons/plumbing-sm.png +0 -0
  639. data/spec/support/static/git-scm.com/images/icons/plumbing-sm@2x.png +0 -0
  640. data/spec/support/static/git-scm.com/images/icons/projects-sm.png +0 -0
  641. data/spec/support/static/git-scm.com/images/icons/projects-sm@2x.png +0 -0
  642. data/spec/support/static/git-scm.com/images/icons/search.png +0 -0
  643. data/spec/support/static/git-scm.com/images/icons/search@2x.png +0 -0
  644. data/spec/support/static/git-scm.com/images/icons/server-admin-sm.png +0 -0
  645. data/spec/support/static/git-scm.com/images/icons/server-admin-sm@2x.png +0 -0
  646. data/spec/support/static/git-scm.com/images/icons/setup-sm.png +0 -0
  647. data/spec/support/static/git-scm.com/images/icons/setup-sm@2x.png +0 -0
  648. data/spec/support/static/git-scm.com/images/icons/sharing-sm.png +0 -0
  649. data/spec/support/static/git-scm.com/images/icons/sharing-sm@2x.png +0 -0
  650. data/spec/support/static/git-scm.com/images/icons/sidebar.png +0 -0
  651. data/spec/support/static/git-scm.com/images/icons/sidebar@2x.png +0 -0
  652. data/spec/support/static/git-scm.com/images/icons/source-code.png +0 -0
  653. data/spec/support/static/git-scm.com/images/icons/source-code@2x.png +0 -0
  654. data/spec/support/static/git-scm.com/images/icons/windows.png +0 -0
  655. data/spec/support/static/git-scm.com/images/icons/windows@2x.png +0 -0
  656. data/spec/support/static/git-scm.com/images/logo@2x.png +0 -0
  657. data/spec/support/static/git-scm.com/images/mobi.png +0 -0
  658. data/spec/support/static/git-scm.com/images/monitor-default.png +0 -0
  659. data/spec/support/static/git-scm.com/images/monitor-default@2x.png +0 -0
  660. data/spec/support/static/git-scm.com/images/monitor-linux.png +0 -0
  661. data/spec/support/static/git-scm.com/images/monitor-linux@2x.png +0 -0
  662. data/spec/support/static/git-scm.com/images/monitor-mac.png +0 -0
  663. data/spec/support/static/git-scm.com/images/monitor-mac@2x.png +0 -0
  664. data/spec/support/static/git-scm.com/images/monitor-windows.png +0 -0
  665. data/spec/support/static/git-scm.com/images/monitor-windows@2x.png +0 -0
  666. data/spec/support/static/git-scm.com/images/pdf.png +0 -0
  667. data/spec/support/static/git-scm.com/images/progit2.png +0 -0
  668. data/spec/support/static/git-scm.com/images/sidebar-divider.png +0 -0
  669. data/spec/support/static/git-scm.com/images/sidebar-divider@2x.png +0 -0
  670. data/spec/support/static/git-scm.com/robots.txt +0 -0
  671. data/spec/task_spec.rb +7 -0
  672. data/wayfarer.gemspec +2 -2
  673. metadata +620 -16
  674. data/lib/wayfarer/middleware/worker.rb +0 -50
  675. data/spec/factories/queue/chain.rb +0 -11
  676. data/spec/middleware/worker_spec.rb +0 -127
@@ -0,0 +1,1605 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <!-- Global site tag (gtag.js) - Google Analytics -->
6
+ <script async src="https://www.googletagmanager.com/gtag/js?id=UA-49925874-3"></script>
7
+ <script>
8
+ window.dataLayer = window.dataLayer || [];
9
+ function gtag(){dataLayer.push(arguments);}
10
+ gtag('js', new Date());
11
+
12
+ gtag('config', 'UA-49925874-3');
13
+ </script>
14
+
15
+ <meta charset='utf-8'>
16
+ <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>
17
+ <meta name="viewport" content="width=device-width, initial-scale=1">
18
+ <title>Git - Advanced Merging</title>
19
+
20
+ <link href='../../../../favicon.ico' rel='shortcut icon' type='image/x-icon'>
21
+
22
+ <link rel="stylesheet" media="screen" href="../../../../assets/application-cafcf280f67db0e6d8168ba98a38da878769a9d5f37793b68ffb963a02d185e0.css" />
23
+ <script src="../../../../assets/modernize-b3ebe0c31c24f230dc62179d3e1030d2e57a53b1668d9382c0a27dbd44a94beb.js"></script>
24
+ <!--[if (gte IE 6)&(lte IE 8)]>
25
+ <script src="/javascripts/selectivizr-min.js"></script>
26
+ <![endif]-->
27
+
28
+ </head>
29
+
30
+ <body id="documentation">
31
+
32
+ <div class="inner">
33
+ <header>
34
+
35
+ <a href="https://git-scm.com/"><img src="../../../../images/logo@2x.png" width="110" height="46" alt="Git" /></a>
36
+ <span id="tagline"></span>
37
+ <script type="text/javascript">
38
+ var taglines = ["fast-version-control","everything-is-local","distributed-even-if-your-workflow-isnt","local-branching-on-the-cheap","distributed-is-the-new-centralized"];
39
+ var tagline = taglines[Math.floor(Math.random() * taglines.length)];
40
+ document.getElementById('tagline').innerHTML = '--' + tagline;
41
+ </script>
42
+ <form id="search" action="https://git-scm.com/search/results">
43
+ <input id="search-text" name="search" placeholder="Search entire site..." autocomplete="off" type="text" />
44
+ </form>
45
+ <div id="search-results"></div>
46
+
47
+ </header>
48
+
49
+ </div> <!-- .inner -->
50
+
51
+ <div class="inner">
52
+ <div id="content-wrapper">
53
+ <button class="sidebar-btn"></button>
54
+ <aside class="sidebar" id="sidebar">
55
+ <nav>
56
+ <ul>
57
+ <li>
58
+ <a href="https://git-scm.com/about">About</a>
59
+ <ul class="">
60
+ <li>
61
+ <a href="https://git-scm.com/about">Branching and Merging</a>
62
+ </li>
63
+ <li>
64
+ <a href="https://git-scm.com/about/small-and-fast">Small and Fast</a>
65
+ </li>
66
+ <li>
67
+ <a href="https://git-scm.com/about/distributed">Distributed</a>
68
+ </li>
69
+ <li>
70
+ <a href="https://git-scm.com/about/info-assurance">Data Assurance</a>
71
+ </li>
72
+ <li>
73
+ <a href="https://git-scm.com/about/staging-area">Staging Area</a>
74
+ </li>
75
+ <li>
76
+ <a href="https://git-scm.com/about/free-and-open-source">Free and Open Source</a>
77
+ </li>
78
+ <li>
79
+ <a href="https://git-scm.com/about/trademark">Trademark</a>
80
+ </li>
81
+ </ul>
82
+ </li>
83
+ <li>
84
+ <a class="active" href="https://git-scm.com/doc">Documentation</a>
85
+ <ul class="expanded">
86
+ <li>
87
+ <a href="https://git-scm.com/docs">Reference</a>
88
+ </li>
89
+ <li>
90
+ <a class="active" href="https://git-scm.com/book">Book</a>
91
+ </li>
92
+ <li>
93
+ <a href="https://git-scm.com/videos">Videos</a>
94
+ </li>
95
+ <li>
96
+ <a href="https://git-scm.com/doc/ext">External Links</a>
97
+ </li>
98
+ </ul>
99
+ </li>
100
+ <li>
101
+ <a href="https://git-scm.com/downloads">Downloads</a>
102
+ <ul class="">
103
+ <li>
104
+ <a href="https://git-scm.com/downloads/guis">GUI Clients</a>
105
+ </li>
106
+ <li>
107
+ <a href="https://git-scm.com/downloads/logos">Logos</a>
108
+ </li>
109
+ </ul>
110
+ </li>
111
+ <li>
112
+ <a href="https://git-scm.com/community">Community</a>
113
+ </li>
114
+ </ul>
115
+ <hr class="sidebar">
116
+ <p>
117
+ This book is available in
118
+ <a href="https://git-scm.com/book/en">English</a>.
119
+ </p>
120
+ <p>
121
+ Full translation available in
122
+ <table>
123
+ <tr><td><a href="https://git-scm.com/book/az">azərbaycan dili</a>,</td></tr>
124
+ <tr><td><a href="https://git-scm.com/book/bg">български език</a>,</td></tr>
125
+ <tr><td><a href="https://git-scm.com/book/de">Deutsch</a>,</td></tr>
126
+ <tr><td><a href="https://git-scm.com/book/es">Español</a>,</td></tr>
127
+ <tr><td><a href="https://git-scm.com/book/fr">Français</a>,</td></tr>
128
+ <tr><td><a href="https://git-scm.com/book/gr">Ελληνικά</a>,</td></tr>
129
+ <tr><td><a href="https://git-scm.com/book/ja">日本語</a>,</td></tr>
130
+ <tr><td><a href="https://git-scm.com/book/ko">한국어</a>,</td></tr>
131
+ <tr><td><a href="https://git-scm.com/book/nl">Nederlands</a>,</td></tr>
132
+ <tr><td><a href="https://git-scm.com/book/ru">Русский</a>,</td></tr>
133
+ <tr><td><a href="https://git-scm.com/book/sl">Slovenščina</a>,</td></tr>
134
+ <tr><td><a href="https://git-scm.com/book/tl">Tagalog</a>,</td></tr>
135
+ <tr><td><a href="https://git-scm.com/book/uk">Українська</a></td></tr>
136
+ <tr><td><a href="https://git-scm.com/book/zh">简体中文</a>,</td></tr>
137
+ </table>
138
+ </p>
139
+ <p>
140
+ Partial translations available in
141
+ <table>
142
+ <tr><td><a href="https://git-scm.com/book/cs">Čeština</a>,</td></tr>
143
+ <tr><td><a href="https://git-scm.com/book/mk">Македонски</a>,</td></tr>
144
+ <tr><td><a href="https://git-scm.com/book/pl">Polski</a>,</td></tr>
145
+ <tr><td><a href="https://git-scm.com/book/sr">Српски</a>,</td></tr>
146
+ <tr><td><a href="https://git-scm.com/book/uz">Ўзбекча</a>,</td></tr>
147
+ <tr><td><a href="https://git-scm.com/book/zh-tw">繁體中文</a>,</td></tr>
148
+ </table>
149
+ </p>
150
+ <p>
151
+ Translations started for
152
+ <table>
153
+ <tr><td><a href="https://git-scm.com/book/be">Беларуская</a>,</td></tr>
154
+ <tr><td><a href="https://git-scm.com/book/fa" dir="rtl">فارسی</a>,</td></tr>
155
+ <tr><td><a href="https://git-scm.com/book/id">Indonesian</a>,</td></tr>
156
+ <tr><td><a href="https://git-scm.com/book/it">Italiano</a>,</td></tr>
157
+ <tr><td><a href="https://git-scm.com/book/ms">Bahasa Melayu</a>,</td></tr>
158
+ <tr><td><a href="https://git-scm.com/book/pt-br">Português (Brasil)</a>,</td></tr>
159
+ <tr><td><a href="https://git-scm.com/book/pt-pt">Português (Portugal)</a>,</td></tr>
160
+ <tr><td><a href="https://git-scm.com/book/sv">Svenska</a>,</td></tr>
161
+ <tr><td><a href="https://git-scm.com/book/tr">Türkçe</a>.</td></tr>
162
+ </table>
163
+ </p>
164
+ <hr class="sidebar"/>
165
+ <p>
166
+ The source of this book is <a href="https://github.com/progit/progit2">hosted on GitHub.</a></br>
167
+ Patches, suggestions and comments are welcome.
168
+ </p>
169
+
170
+
171
+ </nav>
172
+ </aside>
173
+
174
+ <div id="content">
175
+
176
+
177
+ <div id='book-chapters'>
178
+ <a class="dropdown-trigger" id="book-chapters-trigger" data-panel-id="chapters-dropdown" href="_reverse_commit.html#">Chapters ▾</a>
179
+ <div class='dropdown-panel' id='chapters-dropdown'>
180
+ <div class="three-column">
181
+ <div class='column-left'>
182
+ <ol class='book-toc'>
183
+ <li class='chapter'>
184
+ <h2>1. <a href="ch01-getting-started.html">Getting Started</a></h2>
185
+ <ol>
186
+ <li>
187
+ 1.1
188
+ <a href="ch01-getting-started.html" >About Version Control </a>
189
+ </li>
190
+ <li>
191
+ 1.2
192
+ <a href="../Getting-Started-A-Short-History-of-Git.html" >A Short History of Git </a>
193
+ </li>
194
+ <li>
195
+ 1.3
196
+ <a href="what_is_git_section.html" >What is Git? </a>
197
+ </li>
198
+ <li>
199
+ 1.4
200
+ <a href="../Getting-Started-The-Command-Line.html" >The Command Line </a>
201
+ </li>
202
+ <li>
203
+ 1.5
204
+ <a href="../Getting-Started-Installing-Git.html" >Installing Git </a>
205
+ </li>
206
+ <li>
207
+ 1.6
208
+ <a href="_editor.html" >First-Time Git Setup </a>
209
+ </li>
210
+ <li>
211
+ 1.7
212
+ <a href="_git_help.html" >Getting Help </a>
213
+ </li>
214
+ <li>
215
+ 1.8
216
+ <a href="../Getting-Started-Summary.html" >Summary </a>
217
+ </li>
218
+ </ol>
219
+ </li>
220
+ <li class='chapter'>
221
+ <h2>2. <a href="_git_cloning.html">Git Basics</a></h2>
222
+ <ol>
223
+ <li>
224
+ 2.1
225
+ <a href="_git_cloning.html" >Getting a Git Repository </a>
226
+ </li>
227
+ <li>
228
+ 2.2
229
+ <a href="_git_mv.html" >Recording Changes to the Repository </a>
230
+ </li>
231
+ <li>
232
+ 2.3
233
+ <a href="_viewing_history.html" >Viewing the Commit History </a>
234
+ </li>
235
+ <li>
236
+ 2.4
237
+ <a href="_unstaging.html" >Undoing Things </a>
238
+ </li>
239
+ <li>
240
+ 2.5
241
+ <a href="_remote_repos.html" >Working with Remotes </a>
242
+ </li>
243
+ <li>
244
+ 2.6
245
+ <a href="_annotated_tags.html" >Tagging </a>
246
+ </li>
247
+ <li>
248
+ 2.7
249
+ <a href="_git_aliases.html" >Git Aliases </a>
250
+ </li>
251
+ <li>
252
+ 2.8
253
+ <a href="../Git-Basics-Summary.html" >Summary </a>
254
+ </li>
255
+ </ol>
256
+ </li>
257
+ <li class='chapter'>
258
+ <h2>3. <a href="_switching_branches.html">Git Branching</a></h2>
259
+ <ol>
260
+ <li>
261
+ 3.1
262
+ <a href="_switching_branches.html" >Branches in a Nutshell </a>
263
+ </li>
264
+ <li>
265
+ 3.2
266
+ <a href="_basic_branching.html" >Basic Branching and Merging </a>
267
+ </li>
268
+ <li>
269
+ 3.3
270
+ <a href="_branch_management.html" >Branch Management </a>
271
+ </li>
272
+ <li>
273
+ 3.4
274
+ <a href="_topic_branch.html" >Branching Workflows </a>
275
+ </li>
276
+ <li>
277
+ 3.5
278
+ <a href="_delete_branches.html" >Remote Branches </a>
279
+ </li>
280
+ <li>
281
+ 3.6
282
+ <a href="_rebase_rebase.html" >Rebasing </a>
283
+ </li>
284
+ <li>
285
+ 3.7
286
+ <a href="../Git-Branching-Summary.html" >Summary </a>
287
+ </li>
288
+ </ol>
289
+ </li>
290
+ <li class='chapter'>
291
+ <h2>4. <a href="../Git-on-the-Server-The-Protocols.html">Git on the Server</a></h2>
292
+ <ol>
293
+ <li>
294
+ 4.1
295
+ <a href="../Git-on-the-Server-The-Protocols.html" >The Protocols </a>
296
+ </li>
297
+ <li>
298
+ 4.2
299
+ <a href="_bare_repo.html" >Getting Git on a Server </a>
300
+ </li>
301
+ <li>
302
+ 4.3
303
+ <a href="_generate_ssh_key.html" >Generating Your SSH Public Key </a>
304
+ </li>
305
+ <li>
306
+ 4.4
307
+ <a href="_setting_up_server.html" >Setting Up the Server </a>
308
+ </li>
309
+ <li>
310
+ 4.5
311
+ <a href="../Git-on-the-Server-Git-Daemon.html" >Git Daemon </a>
312
+ </li>
313
+ <li>
314
+ 4.6
315
+ <a href="../Git-on-the-Server-Smart-HTTP.html" >Smart HTTP </a>
316
+ </li>
317
+ <li>
318
+ 4.7
319
+ <a href="../Git-on-the-Server-GitWeb.html" >GitWeb </a>
320
+ </li>
321
+ <li>
322
+ 4.8
323
+ <a href="_gitlab_groups_section.html" >GitLab </a>
324
+ </li>
325
+ <li>
326
+ 4.9
327
+ <a href="../Git-on-the-Server-Third-Party-Hosted-Options.html" >Third Party Hosted Options </a>
328
+ </li>
329
+ <li>
330
+ 4.10
331
+ <a href="../Git-on-the-Server-Summary.html" >Summary </a>
332
+ </li>
333
+ </ol>
334
+ </li>
335
+ <li class='chapter'>
336
+ <h2>5. <a href="_integration_manager.html">Distributed Git</a></h2>
337
+ <ol>
338
+ <li>
339
+ 5.1
340
+ <a href="_integration_manager.html" >Distributed Workflows </a>
341
+ </li>
342
+ <li>
343
+ 5.2
344
+ <a href="_project_over_email.html" >Contributing to a Project </a>
345
+ </li>
346
+ <li>
347
+ 5.3
348
+ <a href="_git_am.html" >Maintaining a Project </a>
349
+ </li>
350
+ <li>
351
+ 5.4
352
+ <a href="../Distributed-Git-Summary.html" >Summary </a>
353
+ </li>
354
+ </ol>
355
+ </li>
356
+ </ol>
357
+
358
+ </div>
359
+ <div class='column-middle'>
360
+ <ol class='book-toc'>
361
+ <li class='chapter'>
362
+ <h2>6. <a href="_personal_avatar.html">GitHub</a></h2>
363
+ <ol>
364
+ <li>
365
+ 6.1
366
+ <a href="_personal_avatar.html" >Account Setup and Configuration </a>
367
+ </li>
368
+ <li>
369
+ 6.2
370
+ <a href="_fetch_and_push_on_different_repositories.html" >Contributing to a Project </a>
371
+ </li>
372
+ <li>
373
+ 6.3
374
+ <a href="_email_notifications.html" >Maintaining a Project </a>
375
+ </li>
376
+ <li>
377
+ 6.4
378
+ <a href="_team_page.html" >Managing an organization </a>
379
+ </li>
380
+ <li>
381
+ 6.5
382
+ <a href="_commit_status.html" >Scripting GitHub </a>
383
+ </li>
384
+ <li>
385
+ 6.6
386
+ <a href="../GitHub-Summary.html" >Summary </a>
387
+ </li>
388
+ </ol>
389
+ </li>
390
+ <li class='chapter'>
391
+ <h2>7. <a href="_git_reflog.html">Git Tools</a></h2>
392
+ <ol>
393
+ <li>
394
+ 7.1
395
+ <a href="_git_reflog.html" >Revision Selection </a>
396
+ </li>
397
+ <li>
398
+ 7.2
399
+ <a href="_interactive_staging.html" >Interactive Staging </a>
400
+ </li>
401
+ <li>
402
+ 7.3
403
+ <a href="_git_clean.html" >Stashing and Cleaning </a>
404
+ </li>
405
+ <li>
406
+ 7.4
407
+ <a href="_signing_commits.html" >Signing Your Work </a>
408
+ </li>
409
+ <li>
410
+ 7.5
411
+ <a href="_git_grep.html" >Searching </a>
412
+ </li>
413
+ <li>
414
+ 7.6
415
+ <a href="_removing_file_every_commit.html" >Rewriting History </a>
416
+ </li>
417
+ <li>
418
+ 7.7
419
+ <a href="_the_index.html" >Reset Demystified </a>
420
+ </li>
421
+ <li>
422
+ 7.8
423
+ <a href="_reverse_commit.html" class=active>Advanced Merging </a>
424
+ </li>
425
+ <li>
426
+ 7.9
427
+ <a href="ref_rerere.html" >Rerere </a>
428
+ </li>
429
+ <li>
430
+ 7.10
431
+ <a href="_file_annotation.html" >Debugging with Git </a>
432
+ </li>
433
+ <li>
434
+ 7.11
435
+ <a href="_publishing_submodules.html" >Submodules </a>
436
+ </li>
437
+ <li>
438
+ 7.12
439
+ <a href="_bundling.html" >Bundling </a>
440
+ </li>
441
+ <li>
442
+ 7.13
443
+ <a href="_replace.html" >Replace </a>
444
+ </li>
445
+ <li>
446
+ 7.14
447
+ <a href="_credential_caching.html" >Credential Storage </a>
448
+ </li>
449
+ <li>
450
+ 7.15
451
+ <a href="../Git-Tools-Summary.html" >Summary </a>
452
+ </li>
453
+ </ol>
454
+ </li>
455
+ <li class='chapter'>
456
+ <h2>8. <a href="_external_merge_tools.html">Customizing Git</a></h2>
457
+ <ol>
458
+ <li>
459
+ 8.1
460
+ <a href="_external_merge_tools.html" >Git Configuration </a>
461
+ </li>
462
+ <li>
463
+ 8.2
464
+ <a href="_keyword_expansion.html" >Git Attributes </a>
465
+ </li>
466
+ <li>
467
+ 8.3
468
+ <a href="_email_hooks.html" >Git Hooks </a>
469
+ </li>
470
+ <li>
471
+ 8.4
472
+ <a href="_enforcing_commit_message_format.html" >An Example Git-Enforced Policy </a>
473
+ </li>
474
+ <li>
475
+ 8.5
476
+ <a href="../Customizing-Git-Summary.html" >Summary </a>
477
+ </li>
478
+ </ol>
479
+ </li>
480
+ <li class='chapter'>
481
+ <h2>9. <a href="_git_svn.html">Git and Other Systems</a></h2>
482
+ <ol>
483
+ <li>
484
+ 9.1
485
+ <a href="_git_svn.html" >Git as a Client </a>
486
+ </li>
487
+ <li>
488
+ 9.2
489
+ <a href="_git_p4.html" >Migrating to Git </a>
490
+ </li>
491
+ <li>
492
+ 9.3
493
+ <a href="../Git-and-Other-Systems-Summary.html" >Summary </a>
494
+ </li>
495
+ </ol>
496
+ </li>
497
+ <li class='chapter'>
498
+ <h2>10. <a href="_plumbing_porcelain.html">Git Internals</a></h2>
499
+ <ol>
500
+ <li>
501
+ 10.1
502
+ <a href="_plumbing_porcelain.html" >Plumbing and Porcelain </a>
503
+ </li>
504
+ <li>
505
+ 10.2
506
+ <a href="_git_commit_objects.html" >Git Objects </a>
507
+ </li>
508
+ <li>
509
+ 10.3
510
+ <a href="ref_the_ref.html" >Git References </a>
511
+ </li>
512
+ <li>
513
+ 10.4
514
+ <a href="../Git-Internals-Packfiles.html" >Packfiles </a>
515
+ </li>
516
+ <li>
517
+ 10.5
518
+ <a href="_pushing_refspecs.html" >The Refspec </a>
519
+ </li>
520
+ <li>
521
+ 10.6
522
+ <a href="../Git-Internals-Transfer-Protocols.html" >Transfer Protocols </a>
523
+ </li>
524
+ <li>
525
+ 10.7
526
+ <a href="_git_gc.html" >Maintenance and Data Recovery </a>
527
+ </li>
528
+ <li>
529
+ 10.8
530
+ <a href="../Git-Internals-Environment-Variables.html" >Environment Variables </a>
531
+ </li>
532
+ <li>
533
+ 10.9
534
+ <a href="../Git-Internals-Summary.html" >Summary </a>
535
+ </li>
536
+ </ol>
537
+ </li>
538
+ </ol>
539
+
540
+ </div>
541
+ <div class='column-right'>
542
+ <ol class='book-toc'>
543
+ <li class='chapter'>
544
+ <h2>A1. <a href="../Appendix-A:-Git-in-Other-Environments-Graphical-Interfaces.html">Appendix A: Git in Other Environments</a></h2>
545
+ <ol>
546
+ <li>
547
+ A1.1
548
+ <a href="../Appendix-A:-Git-in-Other-Environments-Graphical-Interfaces.html" >Graphical Interfaces </a>
549
+ </li>
550
+ <li>
551
+ A1.2
552
+ <a href="../Appendix-A:-Git-in-Other-Environments-Git-in-Visual-Studio.html" >Git in Visual Studio </a>
553
+ </li>
554
+ <li>
555
+ A1.3
556
+ <a href="../Appendix-A:-Git-in-Other-Environments-Git-in-Visual-Studio-Code.html" >Git in Visual Studio Code </a>
557
+ </li>
558
+ <li>
559
+ A1.4
560
+ <a href="../Appendix-A:-Git-in-Other-Environments-Git-in-IntelliJ-%252F-PyCharm-%252F-WebStorm-%252F-PhpStorm-%252F-RubyMine.html" >Git in IntelliJ / PyCharm / WebStorm / PhpStorm / RubyMine </a>
561
+ </li>
562
+ <li>
563
+ A1.5
564
+ <a href="../Appendix-A:-Git-in-Other-Environments-Git-in-Sublime-Text.html" >Git in Sublime Text </a>
565
+ </li>
566
+ <li>
567
+ A1.6
568
+ <a href="../Appendix-A:-Git-in-Other-Environments-Git-in-Bash.html" >Git in Bash </a>
569
+ </li>
570
+ <li>
571
+ A1.7
572
+ <a href="oh_my_zsh_git.html" >Git in Zsh </a>
573
+ </li>
574
+ <li>
575
+ A1.8
576
+ <a href="../Appendix-A:-Git-in-Other-Environments-Git-in-PowerShell.html" >Git in PowerShell </a>
577
+ </li>
578
+ <li>
579
+ A1.9
580
+ <a href="../Appendix-A:-Git-in-Other-Environments-Summary.html" >Summary </a>
581
+ </li>
582
+ </ol>
583
+ </li>
584
+ <li class='chapter'>
585
+ <h2>A2. <a href="../Appendix-B:-Embedding-Git-in-your-Applications-Command-line-Git.html">Appendix B: Embedding Git in your Applications</a></h2>
586
+ <ol>
587
+ <li>
588
+ A2.1
589
+ <a href="../Appendix-B:-Embedding-Git-in-your-Applications-Command-line-Git.html" >Command-line Git </a>
590
+ </li>
591
+ <li>
592
+ A2.2
593
+ <a href="_libgit2_bindings.html" >Libgit2 </a>
594
+ </li>
595
+ <li>
596
+ A2.3
597
+ <a href="../Appendix-B:-Embedding-Git-in-your-Applications-JGit.html" >JGit </a>
598
+ </li>
599
+ <li>
600
+ A2.4
601
+ <a href="../Appendix-B:-Embedding-Git-in-your-Applications-go-git.html" >go-git </a>
602
+ </li>
603
+ <li>
604
+ A2.5
605
+ <a href="../Appendix-B:-Embedding-Git-in-your-Applications-Dulwich.html" >Dulwich </a>
606
+ </li>
607
+ </ol>
608
+ </li>
609
+ <li class='chapter'>
610
+ <h2>A3. <a href="ch_core_editor.html">Appendix C: Git Commands</a></h2>
611
+ <ol>
612
+ <li>
613
+ A3.1
614
+ <a href="ch_core_editor.html" >Setup and Config </a>
615
+ </li>
616
+ <li>
617
+ A3.2
618
+ <a href="../Appendix-C:-Git-Commands-Getting-and-Creating-Projects.html" >Getting and Creating Projects </a>
619
+ </li>
620
+ <li>
621
+ A3.3
622
+ <a href="../Appendix-C:-Git-Commands-Basic-Snapshotting.html" >Basic Snapshotting </a>
623
+ </li>
624
+ <li>
625
+ A3.4
626
+ <a href="../Appendix-C:-Git-Commands-Branching-and-Merging.html" >Branching and Merging </a>
627
+ </li>
628
+ <li>
629
+ A3.5
630
+ <a href="../Appendix-C:-Git-Commands-Sharing-and-Updating-Projects.html" >Sharing and Updating Projects </a>
631
+ </li>
632
+ <li>
633
+ A3.6
634
+ <a href="../Appendix-C:-Git-Commands-Inspection-and-Comparison.html" >Inspection and Comparison </a>
635
+ </li>
636
+ <li>
637
+ A3.7
638
+ <a href="../Appendix-C:-Git-Commands-Debugging.html" >Debugging </a>
639
+ </li>
640
+ <li>
641
+ A3.8
642
+ <a href="../Appendix-C:-Git-Commands-Patching.html" >Patching </a>
643
+ </li>
644
+ <li>
645
+ A3.9
646
+ <a href="../Appendix-C:-Git-Commands-Email.html" >Email </a>
647
+ </li>
648
+ <li>
649
+ A3.10
650
+ <a href="../Appendix-C:-Git-Commands-External-Systems.html" >External Systems </a>
651
+ </li>
652
+ <li>
653
+ A3.11
654
+ <a href="../Appendix-C:-Git-Commands-Administration.html" >Administration </a>
655
+ </li>
656
+ <li>
657
+ A3.12
658
+ <a href="../Appendix-C:-Git-Commands-Plumbing-Commands.html" >Plumbing Commands </a>
659
+ </li>
660
+ </ol>
661
+ </li>
662
+ </ol>
663
+
664
+ </div>
665
+ </div>
666
+ </div>
667
+
668
+ <span class="light" id="edition">
669
+ 2nd Edition
670
+ </span>
671
+ </div>
672
+
673
+ <div id='main' class="book edition2">
674
+ <h1>7.8 Git Tools - Advanced Merging</h1>
675
+ <div>
676
+ <h2 id="_advanced_merging">Advanced Merging</h2>
677
+ <div class="paragraph">
678
+ <p>Merging in Git is typically fairly easy.
679
+ Since Git makes it easy to merge another branch multiple times, it means that you can have a very long lived branch but you can keep it up to date as you go, solving small conflicts often, rather than be surprised by one enormous conflict at the end of the series.</p>
680
+ </div>
681
+ <div class="paragraph">
682
+ <p>However, sometimes tricky conflicts do occur.
683
+ Unlike some other version control systems, Git does not try to be overly clever about merge conflict resolution.
684
+ Git’s philosophy is to be smart about determining when a merge resolution is unambiguous, but if there is a conflict, it does not try to be clever about automatically resolving it.
685
+ Therefore, if you wait too long to merge two branches that diverge quickly, you can run into some issues.</p>
686
+ </div>
687
+ <div class="paragraph">
688
+ <p>In this section, we’ll go over what some of those issues might be and what tools Git gives you to help handle these more tricky situations.
689
+ We’ll also cover some of the different, non-standard types of merges you can do, as well as see how to back out of merges that you’ve done.</p>
690
+ </div>
691
+ <div class="sect3">
692
+ <h3 id="_merge_conflicts">Merge Conflicts</h3>
693
+ <div class="paragraph">
694
+ <p>While we covered some basics on resolving merge conflicts in <a href="_basic_merge_conflicts.html">Basic Merge Conflicts</a>, for more complex conflicts, Git provides a few tools to help you figure out what’s going on and how to better deal with the conflict.</p>
695
+ </div>
696
+ <div class="paragraph">
697
+ <p>First of all, if at all possible, try to make sure your working directory is clean before doing a merge that may have conflicts.
698
+ If you have work in progress, either commit it to a temporary branch or stash it.
699
+ This makes it so that you can undo <strong>anything</strong> you try here.
700
+ If you have unsaved changes in your working directory when you try a merge, some of these tips may help you preserve that work.</p>
701
+ </div>
702
+ <div class="paragraph">
703
+ <p>Let’s walk through a very simple example.
704
+ We have a super simple Ruby file that prints 'hello world'.</p>
705
+ </div>
706
+ <div class="listingblock">
707
+ <div class="content">
708
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">#! /usr/bin/env ruby
709
+
710
+ def hello
711
+ puts 'hello world'
712
+ end
713
+
714
+ hello()</code></pre>
715
+ </div>
716
+ </div>
717
+ <div class="paragraph">
718
+ <p>In our repository, we create a new branch named <code>whitespace</code> and proceed to change all the Unix line endings to DOS line endings, essentially changing every line of the file, but just with whitespace.
719
+ Then we change the line “hello world” to “hello mundo”.</p>
720
+ </div>
721
+ <div class="listingblock">
722
+ <div class="content">
723
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git checkout -b whitespace
724
+ Switched to a new branch 'whitespace'
725
+
726
+ $ unix2dos hello.rb
727
+ unix2dos: converting file hello.rb to DOS format ...
728
+ $ git commit -am 'Convert hello.rb to DOS'
729
+ [whitespace 3270f76] Convert hello.rb to DOS
730
+ 1 file changed, 7 insertions(+), 7 deletions(-)
731
+
732
+ $ vim hello.rb
733
+ $ git diff -b
734
+ diff --git a/hello.rb b/hello.rb
735
+ index ac51efd..e85207e 100755
736
+ --- a/hello.rb
737
+ +++ b/hello.rb
738
+ @@ -1,7 +1,7 @@
739
+ #! /usr/bin/env ruby
740
+
741
+ def hello
742
+ - puts 'hello world'
743
+ + puts 'hello mundo'^M
744
+ end
745
+
746
+ hello()
747
+
748
+ $ git commit -am 'Use Spanish instead of English'
749
+ [whitespace 6d338d2] Use Spanish instead of English
750
+ 1 file changed, 1 insertion(+), 1 deletion(-)</code></pre>
751
+ </div>
752
+ </div>
753
+ <div class="paragraph">
754
+ <p>Now we switch back to our <code>master</code> branch and add some documentation for the function.</p>
755
+ </div>
756
+ <div class="listingblock">
757
+ <div class="content">
758
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git checkout master
759
+ Switched to branch 'master'
760
+
761
+ $ vim hello.rb
762
+ $ git diff
763
+ diff --git a/hello.rb b/hello.rb
764
+ index ac51efd..36c06c8 100755
765
+ --- a/hello.rb
766
+ +++ b/hello.rb
767
+ @@ -1,5 +1,6 @@
768
+ #! /usr/bin/env ruby
769
+
770
+ +# prints out a greeting
771
+ def hello
772
+ puts 'hello world'
773
+ end
774
+
775
+ $ git commit -am 'Add comment documenting the function'
776
+ [master bec6336] Add comment documenting the function
777
+ 1 file changed, 1 insertion(+)</code></pre>
778
+ </div>
779
+ </div>
780
+ <div class="paragraph">
781
+ <p>Now we try to merge in our <code>whitespace</code> branch and we’ll get conflicts because of the whitespace changes.</p>
782
+ </div>
783
+ <div class="listingblock">
784
+ <div class="content">
785
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git merge whitespace
786
+ Auto-merging hello.rb
787
+ CONFLICT (content): Merge conflict in hello.rb
788
+ Automatic merge failed; fix conflicts and then commit the result.</code></pre>
789
+ </div>
790
+ </div>
791
+ <div class="sect4">
792
+ <h4 id="_abort_merge">Aborting a Merge</h4>
793
+ <div class="paragraph">
794
+ <p>We now have a few options.
795
+ First, let’s cover how to get out of this situation.
796
+ If you perhaps weren’t expecting conflicts and don’t want to quite deal with the situation yet, you can simply back out of the merge with <code>git merge --abort</code>.</p>
797
+ </div>
798
+ <div class="listingblock">
799
+ <div class="content">
800
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git status -sb
801
+ ## master
802
+ UU hello.rb
803
+
804
+ $ git merge --abort
805
+
806
+ $ git status -sb
807
+ ## master</code></pre>
808
+ </div>
809
+ </div>
810
+ <div class="paragraph">
811
+ <p>The <code>git merge --abort</code> option tries to revert back to your state before you ran the merge.
812
+ The only cases where it may not be able to do this perfectly would be if you had unstashed, uncommitted changes in your working directory when you ran it, otherwise it should work fine.</p>
813
+ </div>
814
+ <div class="paragraph">
815
+ <p>If for some reason you just want to start over, you can also run <code>git reset --hard HEAD</code>, and your repository will be back to the last committed state.
816
+ Remember that any uncommitted work will be lost, so make sure you don’t want any of your changes.</p>
817
+ </div>
818
+ </div>
819
+ <div class="sect4">
820
+ <h4 id="_ignoring_whitespace">Ignoring Whitespace</h4>
821
+ <div class="paragraph">
822
+ <p>In this specific case, the conflicts are whitespace related.
823
+ We know this because the case is simple, but it’s also pretty easy to tell in real cases when looking at the conflict because every line is removed on one side and added again on the other.
824
+ By default, Git sees all of these lines as being changed, so it can’t merge the files.</p>
825
+ </div>
826
+ <div class="paragraph">
827
+ <p>The default merge strategy can take arguments though, and a few of them are about properly ignoring whitespace changes.
828
+ If you see that you have a lot of whitespace issues in a merge, you can simply abort it and do it again, this time with <code>-Xignore-all-space</code> or <code>-Xignore-space-change</code>.
829
+ The first option ignores whitespace <strong>completely</strong> when comparing lines, the second treats sequences of one or more whitespace characters as equivalent.</p>
830
+ </div>
831
+ <div class="listingblock">
832
+ <div class="content">
833
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git merge -Xignore-space-change whitespace
834
+ Auto-merging hello.rb
835
+ Merge made by the 'recursive' strategy.
836
+ hello.rb | 2 +-
837
+ 1 file changed, 1 insertion(+), 1 deletion(-)</code></pre>
838
+ </div>
839
+ </div>
840
+ <div class="paragraph">
841
+ <p>Since in this case, the actual file changes were not conflicting, once we ignore the whitespace changes, everything merges just fine.</p>
842
+ </div>
843
+ <div class="paragraph">
844
+ <p>This is a lifesaver if you have someone on your team who likes to occasionally reformat everything from spaces to tabs or vice-versa.</p>
845
+ </div>
846
+ </div>
847
+ <div class="sect4">
848
+ <h4 id="_manual_remerge">Manual File Re-merging</h4>
849
+ <div class="paragraph">
850
+ <p>Though Git handles whitespace pre-processing pretty well, there are other types of changes that perhaps Git can’t handle automatically, but are scriptable fixes.
851
+ As an example, let’s pretend that Git could not handle the whitespace change and we needed to do it by hand.</p>
852
+ </div>
853
+ <div class="paragraph">
854
+ <p>What we really need to do is run the file we’re trying to merge in through a <code>dos2unix</code> program before trying the actual file merge.
855
+ So how would we do that?</p>
856
+ </div>
857
+ <div class="paragraph">
858
+ <p>First, we get into the merge conflict state.
859
+ Then we want to get copies of my version of the file, their version (from the branch we’re merging in) and the common version (from where both sides branched off).
860
+ Then we want to fix up either their side or our side and re-try the merge again for just this single file.</p>
861
+ </div>
862
+ <div class="paragraph">
863
+ <p>Getting the three file versions is actually pretty easy.
864
+ Git stores all of these versions in the index under “stages” which each have numbers associated with them.
865
+ Stage 1 is the common ancestor, stage 2 is your version and stage 3 is from the <code>MERGE_HEAD</code>, the version you’re merging in (“theirs”).</p>
866
+ </div>
867
+ <div class="paragraph">
868
+ <p>You can extract a copy of each of these versions of the conflicted file with the <code>git show</code> command and a special syntax.</p>
869
+ </div>
870
+ <div class="listingblock">
871
+ <div class="content">
872
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git show :1:hello.rb &gt; hello.common.rb
873
+ $ git show :2:hello.rb &gt; hello.ours.rb
874
+ $ git show :3:hello.rb &gt; hello.theirs.rb</code></pre>
875
+ </div>
876
+ </div>
877
+ <div class="paragraph">
878
+ <p>If you want to get a little more hard core, you can also use the <code>ls-files -u</code> plumbing command to get the actual SHA-1s of the Git blobs for each of these files.</p>
879
+ </div>
880
+ <div class="listingblock">
881
+ <div class="content">
882
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git ls-files -u
883
+ 100755 ac51efdc3df4f4fd328d1a02ad05331d8e2c9111 1 hello.rb
884
+ 100755 36c06c8752c78d2aff89571132f3bf7841a7b5c3 2 hello.rb
885
+ 100755 e85207e04dfdd5eb0a1e9febbc67fd837c44a1cd 3 hello.rb</code></pre>
886
+ </div>
887
+ </div>
888
+ <div class="paragraph">
889
+ <p>The <code>:1:hello.rb</code> is just a shorthand for looking up that blob SHA-1.</p>
890
+ </div>
891
+ <div class="paragraph">
892
+ <p>Now that we have the content of all three stages in our working directory, we can manually fix up theirs to fix the whitespace issue and re-merge the file with the little-known <code>git merge-file</code> command which does just that.</p>
893
+ </div>
894
+ <div class="listingblock">
895
+ <div class="content">
896
+ <pre class="highlight"><code class="language-console" data-lang="console">$ dos2unix hello.theirs.rb
897
+ dos2unix: converting file hello.theirs.rb to Unix format ...
898
+
899
+ $ git merge-file -p \
900
+ hello.ours.rb hello.common.rb hello.theirs.rb &gt; hello.rb
901
+
902
+ $ git diff -b
903
+ diff --cc hello.rb
904
+ index 36c06c8,e85207e..0000000
905
+ --- a/hello.rb
906
+ +++ b/hello.rb
907
+ @@@ -1,8 -1,7 +1,8 @@@
908
+ #! /usr/bin/env ruby
909
+
910
+ +# prints out a greeting
911
+ def hello
912
+ - puts 'hello world'
913
+ + puts 'hello mundo'
914
+ end
915
+
916
+ hello()</code></pre>
917
+ </div>
918
+ </div>
919
+ <div class="paragraph">
920
+ <p>At this point we have nicely merged the file.
921
+ In fact, this actually works better than the <code>ignore-space-change</code> option because this actually fixes the whitespace changes before merge instead of simply ignoring them.
922
+ In the <code>ignore-space-change</code> merge, we actually ended up with a few lines with DOS line endings, making things mixed.</p>
923
+ </div>
924
+ <div class="paragraph">
925
+ <p>If you want to get an idea before finalizing this commit about what was actually changed between one side or the other, you can ask <code>git diff</code> to compare what is in your working directory that you’re about to commit as the result of the merge to any of these stages.
926
+ Let’s go through them all.</p>
927
+ </div>
928
+ <div class="paragraph">
929
+ <p>To compare your result to what you had in your branch before the merge, in other words, to see what the merge introduced, you can run <code>git diff --ours</code>:</p>
930
+ </div>
931
+ <div class="listingblock">
932
+ <div class="content">
933
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git diff --ours
934
+ * Unmerged path hello.rb
935
+ diff --git a/hello.rb b/hello.rb
936
+ index 36c06c8..44d0a25 100755
937
+ --- a/hello.rb
938
+ +++ b/hello.rb
939
+ @@ -2,7 +2,7 @@
940
+
941
+ # prints out a greeting
942
+ def hello
943
+ - puts 'hello world'
944
+ + puts 'hello mundo'
945
+ end
946
+
947
+ hello()</code></pre>
948
+ </div>
949
+ </div>
950
+ <div class="paragraph">
951
+ <p>So here we can easily see that what happened in our branch, what we’re actually introducing to this file with this merge, is changing that single line.</p>
952
+ </div>
953
+ <div class="paragraph">
954
+ <p>If we want to see how the result of the merge differed from what was on their side, you can run <code>git diff --theirs</code>.
955
+ In this and the following example, we have to use <code>-b</code> to strip out the whitespace because we’re comparing it to what is in Git, not our cleaned up <code>hello.theirs.rb</code> file.</p>
956
+ </div>
957
+ <div class="listingblock">
958
+ <div class="content">
959
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git diff --theirs -b
960
+ * Unmerged path hello.rb
961
+ diff --git a/hello.rb b/hello.rb
962
+ index e85207e..44d0a25 100755
963
+ --- a/hello.rb
964
+ +++ b/hello.rb
965
+ @@ -1,5 +1,6 @@
966
+ #! /usr/bin/env ruby
967
+
968
+ +# prints out a greeting
969
+ def hello
970
+ puts 'hello mundo'
971
+ end</code></pre>
972
+ </div>
973
+ </div>
974
+ <div class="paragraph">
975
+ <p>Finally, you can see how the file has changed from both sides with <code>git diff --base</code>.</p>
976
+ </div>
977
+ <div class="listingblock">
978
+ <div class="content">
979
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git diff --base -b
980
+ * Unmerged path hello.rb
981
+ diff --git a/hello.rb b/hello.rb
982
+ index ac51efd..44d0a25 100755
983
+ --- a/hello.rb
984
+ +++ b/hello.rb
985
+ @@ -1,7 +1,8 @@
986
+ #! /usr/bin/env ruby
987
+
988
+ +# prints out a greeting
989
+ def hello
990
+ - puts 'hello world'
991
+ + puts 'hello mundo'
992
+ end
993
+
994
+ hello()</code></pre>
995
+ </div>
996
+ </div>
997
+ <div class="paragraph">
998
+ <p>At this point we can use the <code>git clean</code> command to clear out the extra files we created to do the manual merge but no longer need.</p>
999
+ </div>
1000
+ <div class="listingblock">
1001
+ <div class="content">
1002
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git clean -f
1003
+ Removing hello.common.rb
1004
+ Removing hello.ours.rb
1005
+ Removing hello.theirs.rb</code></pre>
1006
+ </div>
1007
+ </div>
1008
+ </div>
1009
+ <div class="sect4">
1010
+ <h4 id="_checking_out_conflicts">Checking Out Conflicts</h4>
1011
+ <div class="paragraph">
1012
+ <p>Perhaps we’re not happy with the resolution at this point for some reason, or maybe manually editing one or both sides still didn’t work well and we need more context.</p>
1013
+ </div>
1014
+ <div class="paragraph">
1015
+ <p>Let’s change up the example a little.
1016
+ For this example, we have two longer lived branches that each have a few commits in them but create a legitimate content conflict when merged.</p>
1017
+ </div>
1018
+ <div class="listingblock">
1019
+ <div class="content">
1020
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git log --graph --oneline --decorate --all
1021
+ * f1270f7 (HEAD, master) Update README
1022
+ * 9af9d3b Create README
1023
+ * 694971d Update phrase to 'hola world'
1024
+ | * e3eb223 (mundo) Add more tests
1025
+ | * 7cff591 Create initial testing script
1026
+ | * c3ffff1 Change text to 'hello mundo'
1027
+ |/
1028
+ * b7dcc89 Initial hello world code</code></pre>
1029
+ </div>
1030
+ </div>
1031
+ <div class="paragraph">
1032
+ <p>We now have three unique commits that live only on the <code>master</code> branch and three others that live on the <code>mundo</code> branch.
1033
+ If we try to merge the <code>mundo</code> branch in, we get a conflict.</p>
1034
+ </div>
1035
+ <div class="listingblock">
1036
+ <div class="content">
1037
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git merge mundo
1038
+ Auto-merging hello.rb
1039
+ CONFLICT (content): Merge conflict in hello.rb
1040
+ Automatic merge failed; fix conflicts and then commit the result.</code></pre>
1041
+ </div>
1042
+ </div>
1043
+ <div class="paragraph">
1044
+ <p>We would like to see what the merge conflict is.
1045
+ If we open up the file, we’ll see something like this:</p>
1046
+ </div>
1047
+ <div class="listingblock">
1048
+ <div class="content">
1049
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">#! /usr/bin/env ruby
1050
+
1051
+ def hello
1052
+ &lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
1053
+ puts 'hola world'
1054
+ =======
1055
+ puts 'hello mundo'
1056
+ &gt;&gt;&gt;&gt;&gt;&gt;&gt; mundo
1057
+ end
1058
+
1059
+ hello()</code></pre>
1060
+ </div>
1061
+ </div>
1062
+ <div class="paragraph">
1063
+ <p>Both sides of the merge added content to this file, but some of the commits modified the file in the same place that caused this conflict.</p>
1064
+ </div>
1065
+ <div class="paragraph">
1066
+ <p>Let’s explore a couple of tools that you now have at your disposal to determine how this conflict came to be.
1067
+ Perhaps it’s not obvious how exactly you should fix this conflict.
1068
+ You need more context.</p>
1069
+ </div>
1070
+ <div class="paragraph">
1071
+ <p>One helpful tool is <code>git checkout</code> with the <code>--conflict</code> option.
1072
+ This will re-checkout the file again and replace the merge conflict markers.
1073
+ This can be useful if you want to reset the markers and try to resolve them again.</p>
1074
+ </div>
1075
+ <div class="paragraph">
1076
+ <p>You can pass <code>--conflict</code> either <code>diff3</code> or <code>merge</code> (which is the default).
1077
+ If you pass it <code>diff3</code>, Git will use a slightly different version of conflict markers, not only giving you the “ours” and “theirs” versions, but also the “base” version inline to give you more context.</p>
1078
+ </div>
1079
+ <div class="listingblock">
1080
+ <div class="content">
1081
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git checkout --conflict=diff3 hello.rb</code></pre>
1082
+ </div>
1083
+ </div>
1084
+ <div class="paragraph">
1085
+ <p>Once we run that, the file will look like this instead:</p>
1086
+ </div>
1087
+ <div class="listingblock">
1088
+ <div class="content">
1089
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">#! /usr/bin/env ruby
1090
+
1091
+ def hello
1092
+ &lt;&lt;&lt;&lt;&lt;&lt;&lt; ours
1093
+ puts 'hola world'
1094
+ ||||||| base
1095
+ puts 'hello world'
1096
+ =======
1097
+ puts 'hello mundo'
1098
+ &gt;&gt;&gt;&gt;&gt;&gt;&gt; theirs
1099
+ end
1100
+
1101
+ hello()</code></pre>
1102
+ </div>
1103
+ </div>
1104
+ <div class="paragraph">
1105
+ <p>If you like this format, you can set it as the default for future merge conflicts by setting the <code>merge.conflictstyle</code> setting to <code>diff3</code>.</p>
1106
+ </div>
1107
+ <div class="listingblock">
1108
+ <div class="content">
1109
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git config --global merge.conflictstyle diff3</code></pre>
1110
+ </div>
1111
+ </div>
1112
+ <div class="paragraph">
1113
+ <p>The <code>git checkout</code> command can also take <code>--ours</code> and <code>--theirs</code> options, which can be a really fast way of just choosing either one side or the other without merging things at all.</p>
1114
+ </div>
1115
+ <div class="paragraph">
1116
+ <p>This can be particularly useful for conflicts of binary files where you can simply choose one side, or where you only want to merge certain files in from another branch — you can do the merge and then checkout certain files from one side or the other before committing.</p>
1117
+ </div>
1118
+ </div>
1119
+ <div class="sect4">
1120
+ <h4 id="_merge_log">Merge Log</h4>
1121
+ <div class="paragraph">
1122
+ <p>Another useful tool when resolving merge conflicts is <code>git log</code>.
1123
+ This can help you get context on what may have contributed to the conflicts.
1124
+ Reviewing a little bit of history to remember why two lines of development were touching the same area of code can be really helpful sometimes.</p>
1125
+ </div>
1126
+ <div class="paragraph">
1127
+ <p>To get a full list of all of the unique commits that were included in either branch involved in this merge, we can use the “triple dot” syntax that we learned in <a href="_triple_dot.html">Triple Dot</a>.</p>
1128
+ </div>
1129
+ <div class="listingblock">
1130
+ <div class="content">
1131
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git log --oneline --left-right HEAD...MERGE_HEAD
1132
+ &lt; f1270f7 Update README
1133
+ &lt; 9af9d3b Create README
1134
+ &lt; 694971d Update phrase to 'hola world'
1135
+ &gt; e3eb223 Add more tests
1136
+ &gt; 7cff591 Create initial testing script
1137
+ &gt; c3ffff1 Change text to 'hello mundo'</code></pre>
1138
+ </div>
1139
+ </div>
1140
+ <div class="paragraph">
1141
+ <p>That’s a nice list of the six total commits involved, as well as which line of development each commit was on.</p>
1142
+ </div>
1143
+ <div class="paragraph">
1144
+ <p>We can further simplify this though to give us much more specific context.
1145
+ If we add the <code>--merge</code> option to <code>git log</code>, it will only show the commits in either side of the merge that touch a file that’s currently conflicted.</p>
1146
+ </div>
1147
+ <div class="listingblock">
1148
+ <div class="content">
1149
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git log --oneline --left-right --merge
1150
+ &lt; 694971d Update phrase to 'hola world'
1151
+ &gt; c3ffff1 Change text to 'hello mundo'</code></pre>
1152
+ </div>
1153
+ </div>
1154
+ <div class="paragraph">
1155
+ <p>If you run that with the <code>-p</code> option instead, you get just the diffs to the file that ended up in conflict.
1156
+ This can be <strong>really</strong> helpful in quickly giving you the context you need to help understand why something conflicts and how to more intelligently resolve it.</p>
1157
+ </div>
1158
+ </div>
1159
+ <div class="sect4">
1160
+ <h4 id="_combined_diff_format">Combined Diff Format</h4>
1161
+ <div class="paragraph">
1162
+ <p>Since Git stages any merge results that are successful, when you run <code>git diff</code> while in a conflicted merge state, you only get what is currently still in conflict.
1163
+ This can be helpful to see what you still have to resolve.</p>
1164
+ </div>
1165
+ <div class="paragraph">
1166
+ <p>When you run <code>git diff</code> directly after a merge conflict, it will give you information in a rather unique diff output format.</p>
1167
+ </div>
1168
+ <div class="listingblock">
1169
+ <div class="content">
1170
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git diff
1171
+ diff --cc hello.rb
1172
+ index 0399cd5,59727f0..0000000
1173
+ --- a/hello.rb
1174
+ +++ b/hello.rb
1175
+ @@@ -1,7 -1,7 +1,11 @@@
1176
+ #! /usr/bin/env ruby
1177
+
1178
+ def hello
1179
+ ++&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
1180
+ + puts 'hola world'
1181
+ ++=======
1182
+ + puts 'hello mundo'
1183
+ ++&gt;&gt;&gt;&gt;&gt;&gt;&gt; mundo
1184
+ end
1185
+
1186
+ hello()</code></pre>
1187
+ </div>
1188
+ </div>
1189
+ <div class="paragraph">
1190
+ <p>The format is called “Combined Diff” and gives you two columns of data next to each line.
1191
+ The first column shows you if that line is different (added or removed) between the “ours” branch and the file in your working directory and the second column does the same between the “theirs” branch and your working directory copy.</p>
1192
+ </div>
1193
+ <div class="paragraph">
1194
+ <p>So in that example you can see that the <code>&lt;&lt;&lt;&lt;&lt;&lt;&lt;</code> and <code>&gt;&gt;&gt;&gt;&gt;&gt;&gt;</code> lines are in the working copy but were not in either side of the merge.
1195
+ This makes sense because the merge tool stuck them in there for our context, but we’re expected to remove them.</p>
1196
+ </div>
1197
+ <div class="paragraph">
1198
+ <p>If we resolve the conflict and run <code>git diff</code> again, we’ll see the same thing, but it’s a little more useful.</p>
1199
+ </div>
1200
+ <div class="listingblock">
1201
+ <div class="content">
1202
+ <pre class="highlight"><code class="language-console" data-lang="console">$ vim hello.rb
1203
+ $ git diff
1204
+ diff --cc hello.rb
1205
+ index 0399cd5,59727f0..0000000
1206
+ --- a/hello.rb
1207
+ +++ b/hello.rb
1208
+ @@@ -1,7 -1,7 +1,7 @@@
1209
+ #! /usr/bin/env ruby
1210
+
1211
+ def hello
1212
+ - puts 'hola world'
1213
+ - puts 'hello mundo'
1214
+ ++ puts 'hola mundo'
1215
+ end
1216
+
1217
+ hello()</code></pre>
1218
+ </div>
1219
+ </div>
1220
+ <div class="paragraph">
1221
+ <p>This shows us that “hola world” was in our side but not in the working copy, that “hello mundo” was in their side but not in the working copy and finally that “hola mundo” was not in either side but is now in the working copy.
1222
+ This can be useful to review before committing the resolution.</p>
1223
+ </div>
1224
+ <div class="paragraph">
1225
+ <p>You can also get this from the <code>git log</code> for any merge to see how something was resolved after the fact.
1226
+ Git will output this format if you run <code>git show</code> on a merge commit, or if you add a <code>--cc</code> option to a <code>git log -p</code> (which by default only shows patches for non-merge commits).</p>
1227
+ </div>
1228
+ <div class="listingblock">
1229
+ <div class="content">
1230
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git log --cc -p -1
1231
+ commit 14f41939956d80b9e17bb8721354c33f8d5b5a79
1232
+ Merge: f1270f7 e3eb223
1233
+ Author: Scott Chacon &lt;schacon@gmail.com&gt;
1234
+ Date: Fri Sep 19 18:14:49 2014 +0200
1235
+
1236
+ Merge branch 'mundo'
1237
+
1238
+ Conflicts:
1239
+ hello.rb
1240
+
1241
+ diff --cc hello.rb
1242
+ index 0399cd5,59727f0..e1d0799
1243
+ --- a/hello.rb
1244
+ +++ b/hello.rb
1245
+ @@@ -1,7 -1,7 +1,7 @@@
1246
+ #! /usr/bin/env ruby
1247
+
1248
+ def hello
1249
+ - puts 'hola world'
1250
+ - puts 'hello mundo'
1251
+ ++ puts 'hola mundo'
1252
+ end
1253
+
1254
+ hello()</code></pre>
1255
+ </div>
1256
+ </div>
1257
+ </div>
1258
+ </div>
1259
+ <div class="sect3">
1260
+ <h3 id="_undoing_merges">Undoing Merges</h3>
1261
+ <div class="paragraph">
1262
+ <p>Now that you know how to create a merge commit, you’ll probably make some by mistake.
1263
+ One of the great things about working with Git is that it’s okay to make mistakes, because it’s possible (and in many cases easy) to fix them.</p>
1264
+ </div>
1265
+ <div class="paragraph">
1266
+ <p>Merge commits are no different.
1267
+ Let’s say you started work on a topic branch, accidentally merged it into <code>master</code>, and now your commit history looks like this:</p>
1268
+ </div>
1269
+ <div class="imageblock">
1270
+ <div class="content">
1271
+ <img src="../images/undomerge-start.png" alt="Accidental merge commit">
1272
+ </div>
1273
+ <div class="title">Figure 137. Accidental merge commit</div>
1274
+ </div>
1275
+ <div class="paragraph">
1276
+ <p>There are two ways to approach this problem, depending on what your desired outcome is.</p>
1277
+ </div>
1278
+ <div class="sect4">
1279
+ <h4 id="_fix_the_references">Fix the references</h4>
1280
+ <div class="paragraph">
1281
+ <p>If the unwanted merge commit only exists on your local repository, the easiest and best solution is to move the branches so that they point where you want them to.
1282
+ In most cases, if you follow the errant <code>git merge</code> with <code>git reset --hard HEAD~</code>, this will reset the branch pointers so they look like this:</p>
1283
+ </div>
1284
+ <div class="imageblock">
1285
+ <div class="content">
1286
+ <img src="../images/undomerge-reset.png" alt="History after `git reset --hard HEAD~`">
1287
+ </div>
1288
+ <div class="title">Figure 138. History after <code>git reset --hard HEAD~</code>
1289
+ </div>
1290
+ </div>
1291
+ <div class="paragraph">
1292
+ <p>We covered <code>reset</code> back in <a href="_git_reset.html">Reset Demystified</a>, so it shouldn’t be too hard to figure out what’s going on here.
1293
+ Here’s a quick refresher: <code>reset --hard</code> usually goes through three steps:</p>
1294
+ </div>
1295
+ <div class="olist arabic">
1296
+ <ol class="arabic">
1297
+ <li>
1298
+ <p>Move the branch HEAD points to.
1299
+ In this case, we want to move <code>master</code> to where it was before the merge commit (<code>C6</code>).</p>
1300
+ </li>
1301
+ <li>
1302
+ <p>Make the index look like HEAD.</p>
1303
+ </li>
1304
+ <li>
1305
+ <p>Make the working directory look like the index.</p>
1306
+ </li>
1307
+ </ol>
1308
+ </div>
1309
+ <div class="paragraph">
1310
+ <p>The downside of this approach is that it’s rewriting history, which can be problematic with a shared repository.
1311
+ Check out <a href="_rebase_peril.html">The Perils of Rebasing</a> for more on what can happen; the short version is that if other people have the commits you’re rewriting, you should probably avoid <code>reset</code>.
1312
+ This approach also won’t work if any other commits have been created since the merge; moving the refs would effectively lose those changes.</p>
1313
+ </div>
1314
+ </div>
1315
+ <div class="sect4">
1316
+ <h4 id="_reverse_commit">Reverse the commit</h4>
1317
+ <div class="paragraph">
1318
+ <p>If moving the branch pointers around isn’t going to work for you, Git gives you the option of making a new commit which undoes all the changes from an existing one.
1319
+ Git calls this operation a “revert”, and in this particular scenario, you’d invoke it like this:</p>
1320
+ </div>
1321
+ <div class="listingblock">
1322
+ <div class="content">
1323
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git revert -m 1 HEAD
1324
+ [master b1d8379] Revert "Merge branch 'topic'"</code></pre>
1325
+ </div>
1326
+ </div>
1327
+ <div class="paragraph">
1328
+ <p>The <code>-m 1</code> flag indicates which parent is the “mainline” and should be kept.
1329
+ When you invoke a merge into <code>HEAD</code> (<code>git merge topic</code>), the new commit has two parents: the first one is <code>HEAD</code> (<code>C6</code>), and the second is the tip of the branch being merged in (<code>C4</code>).
1330
+ In this case, we want to undo all the changes introduced by merging in parent #2 (<code>C4</code>), while keeping all the content from parent #1 (<code>C6</code>).</p>
1331
+ </div>
1332
+ <div class="paragraph">
1333
+ <p>The history with the revert commit looks like this:</p>
1334
+ </div>
1335
+ <div class="imageblock">
1336
+ <div class="content">
1337
+ <img src="../images/undomerge-revert.png" alt="History after `git revert -m 1`">
1338
+ </div>
1339
+ <div class="title">Figure 139. History after <code>git revert -m 1</code>
1340
+ </div>
1341
+ </div>
1342
+ <div class="paragraph">
1343
+ <p>The new commit <code>^M</code> has exactly the same contents as <code>C6</code>, so starting from here it’s as if the merge never happened, except that the now-unmerged commits are still in <code>HEAD</code>’s history.
1344
+ Git will get confused if you try to merge <code>topic</code> into <code>master</code> again:</p>
1345
+ </div>
1346
+ <div class="listingblock">
1347
+ <div class="content">
1348
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git merge topic
1349
+ Already up-to-date.</code></pre>
1350
+ </div>
1351
+ </div>
1352
+ <div class="paragraph">
1353
+ <p>There’s nothing in <code>topic</code> that isn’t already reachable from <code>master</code>.
1354
+ What’s worse, if you add work to <code>topic</code> and merge again, Git will only bring in the changes <em>since</em> the reverted merge:</p>
1355
+ </div>
1356
+ <div class="imageblock">
1357
+ <div class="content">
1358
+ <img src="../images/undomerge-revert2.png" alt="History with a bad merge">
1359
+ </div>
1360
+ <div class="title">Figure 140. History with a bad merge</div>
1361
+ </div>
1362
+ <div class="paragraph">
1363
+ <p>The best way around this is to un-revert the original merge, since now you want to bring in the changes that were reverted out, <strong>then</strong> create a new merge commit:</p>
1364
+ </div>
1365
+ <div class="listingblock">
1366
+ <div class="content">
1367
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git revert ^M
1368
+ [master 09f0126] Revert "Revert "Merge branch 'topic'""
1369
+ $ git merge topic</code></pre>
1370
+ </div>
1371
+ </div>
1372
+ <div class="imageblock">
1373
+ <div class="content">
1374
+ <img src="../images/undomerge-revert3.png" alt="History after re-merging a reverted merge">
1375
+ </div>
1376
+ <div class="title">Figure 141. History after re-merging a reverted merge</div>
1377
+ </div>
1378
+ <div class="paragraph">
1379
+ <p>In this example, <code>M</code> and <code>^M</code> cancel out.
1380
+ <code>^^M</code> effectively merges in the changes from <code>C3</code> and <code>C4</code>, and <code>C8</code> merges in the changes from <code>C7</code>, so now <code>topic</code> is fully merged.</p>
1381
+ </div>
1382
+ </div>
1383
+ </div>
1384
+ <div class="sect3">
1385
+ <h3 id="_other_types_of_merges">Other Types of Merges</h3>
1386
+ <div class="paragraph">
1387
+ <p>So far we’ve covered the normal merge of two branches, normally handled with what is called the “recursive” strategy of merging.
1388
+ There are other ways to merge branches together however.
1389
+ Let’s cover a few of them quickly.</p>
1390
+ </div>
1391
+ <div class="sect4">
1392
+ <h4 id="_our_or_theirs_preference">Our or Theirs Preference</h4>
1393
+ <div class="paragraph">
1394
+ <p>First of all, there is another useful thing we can do with the normal “recursive” mode of merging.
1395
+ We’ve already seen the <code>ignore-all-space</code> and <code>ignore-space-change</code> options which are passed with a <code>-X</code> but we can also tell Git to favor one side or the other when it sees a conflict.</p>
1396
+ </div>
1397
+ <div class="paragraph">
1398
+ <p>By default, when Git sees a conflict between two branches being merged, it will add merge conflict markers into your code and mark the file as conflicted and let you resolve it.
1399
+ If you would prefer for Git to simply choose a specific side and ignore the other side instead of letting you manually resolve the conflict, you can pass the <code>merge</code> command either a <code>-Xours</code> or <code>-Xtheirs</code>.</p>
1400
+ </div>
1401
+ <div class="paragraph">
1402
+ <p>If Git sees this, it will not add conflict markers.
1403
+ Any differences that are mergeable, it will merge.
1404
+ Any differences that conflict, it will simply choose the side you specify in whole, including binary files.</p>
1405
+ </div>
1406
+ <div class="paragraph">
1407
+ <p>If we go back to the “hello world” example we were using before, we can see that merging in our branch causes conflicts.</p>
1408
+ </div>
1409
+ <div class="listingblock">
1410
+ <div class="content">
1411
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git merge mundo
1412
+ Auto-merging hello.rb
1413
+ CONFLICT (content): Merge conflict in hello.rb
1414
+ Resolved 'hello.rb' using previous resolution.
1415
+ Automatic merge failed; fix conflicts and then commit the result.</code></pre>
1416
+ </div>
1417
+ </div>
1418
+ <div class="paragraph">
1419
+ <p>However if we run it with <code>-Xours</code> or <code>-Xtheirs</code> it does not.</p>
1420
+ </div>
1421
+ <div class="listingblock">
1422
+ <div class="content">
1423
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git merge -Xours mundo
1424
+ Auto-merging hello.rb
1425
+ Merge made by the 'recursive' strategy.
1426
+ hello.rb | 2 +-
1427
+ test.sh | 2 ++
1428
+ 2 files changed, 3 insertions(+), 1 deletion(-)
1429
+ create mode 100644 test.sh</code></pre>
1430
+ </div>
1431
+ </div>
1432
+ <div class="paragraph">
1433
+ <p>In that case, instead of getting conflict markers in the file with “hello mundo” on one side and “hola world” on the other, it will simply pick “hola world”.
1434
+ However, all the other non-conflicting changes on that branch are merged successfully in.</p>
1435
+ </div>
1436
+ <div class="paragraph">
1437
+ <p>This option can also be passed to the <code>git merge-file</code> command we saw earlier by running something like <code>git merge-file --ours</code> for individual file merges.</p>
1438
+ </div>
1439
+ <div class="paragraph">
1440
+ <p>If you want to do something like this but not have Git even try to merge changes from the other side in, there is a more draconian option, which is the “ours” merge <em>strategy</em>.
1441
+ This is different from the “ours” recursive merge <em>option</em>.</p>
1442
+ </div>
1443
+ <div class="paragraph">
1444
+ <p>This will basically do a fake merge.
1445
+ It will record a new merge commit with both branches as parents, but it will not even look at the branch you’re merging in.
1446
+ It will simply record as the result of the merge the exact code in your current branch.</p>
1447
+ </div>
1448
+ <div class="listingblock">
1449
+ <div class="content">
1450
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git merge -s ours mundo
1451
+ Merge made by the 'ours' strategy.
1452
+ $ git diff HEAD HEAD~
1453
+ $</code></pre>
1454
+ </div>
1455
+ </div>
1456
+ <div class="paragraph">
1457
+ <p>You can see that there is no difference between the branch we were on and the result of the merge.</p>
1458
+ </div>
1459
+ <div class="paragraph">
1460
+ <p>This can often be useful to basically trick Git into thinking that a branch is already merged when doing a merge later on.
1461
+ For example, say you branched off a <code>release</code> branch and have done some work on it that you will want to merge back into your <code>master</code> branch at some point.
1462
+ In the meantime some bugfix on <code>master</code> needs to be backported into your <code>release</code> branch.
1463
+ You can merge the bugfix branch into the <code>release</code> branch and also <code>merge -s ours</code> the same branch into your <code>master</code> branch (even though the fix is already there) so when you later merge the <code>release</code> branch again, there are no conflicts from the bugfix.</p>
1464
+ </div>
1465
+ </div>
1466
+ <div class="sect4">
1467
+ <h4 id="_subtree_merge">Subtree Merging</h4>
1468
+ <div class="paragraph">
1469
+ <p>The idea of the subtree merge is that you have two projects, and one of the projects maps to a subdirectory of the other one.
1470
+ When you specify a subtree merge, Git is often smart enough to figure out that one is a subtree of the other and merge appropriately.</p>
1471
+ </div>
1472
+ <div class="paragraph">
1473
+ <p>We’ll go through an example of adding a separate project into an existing project and then merging the code of the second into a subdirectory of the first.</p>
1474
+ </div>
1475
+ <div class="paragraph">
1476
+ <p>First, we’ll add the Rack application to our project.
1477
+ We’ll add the Rack project as a remote reference in our own project and then check it out into its own branch:</p>
1478
+ </div>
1479
+ <div class="listingblock">
1480
+ <div class="content">
1481
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git remote add rack_remote https://github.com/rack/rack
1482
+ $ git fetch rack_remote --no-tags
1483
+ warning: no common commits
1484
+ remote: Counting objects: 3184, done.
1485
+ remote: Compressing objects: 100% (1465/1465), done.
1486
+ remote: Total 3184 (delta 1952), reused 2770 (delta 1675)
1487
+ Receiving objects: 100% (3184/3184), 677.42 KiB | 4 KiB/s, done.
1488
+ Resolving deltas: 100% (1952/1952), done.
1489
+ From https://github.com/rack/rack
1490
+ * [new branch] build -&gt; rack_remote/build
1491
+ * [new branch] master -&gt; rack_remote/master
1492
+ * [new branch] rack-0.4 -&gt; rack_remote/rack-0.4
1493
+ * [new branch] rack-0.9 -&gt; rack_remote/rack-0.9
1494
+ $ git checkout -b rack_branch rack_remote/master
1495
+ Branch rack_branch set up to track remote branch refs/remotes/rack_remote/master.
1496
+ Switched to a new branch "rack_branch"</code></pre>
1497
+ </div>
1498
+ </div>
1499
+ <div class="paragraph">
1500
+ <p>Now we have the root of the Rack project in our <code>rack_branch</code> branch and our own project in the <code>master</code> branch.
1501
+ If you check out one and then the other, you can see that they have different project roots:</p>
1502
+ </div>
1503
+ <div class="listingblock">
1504
+ <div class="content">
1505
+ <pre class="highlight"><code class="language-console" data-lang="console">$ ls
1506
+ AUTHORS KNOWN-ISSUES Rakefile contrib lib
1507
+ COPYING README bin example test
1508
+ $ git checkout master
1509
+ Switched to branch "master"
1510
+ $ ls
1511
+ README</code></pre>
1512
+ </div>
1513
+ </div>
1514
+ <div class="paragraph">
1515
+ <p>This is sort of a strange concept.
1516
+ Not all the branches in your repository actually have to be branches of the same project.
1517
+ It’s not common, because it’s rarely helpful, but it’s fairly easy to have branches contain completely different histories.</p>
1518
+ </div>
1519
+ <div class="paragraph">
1520
+ <p>In this case, we want to pull the Rack project into our <code>master</code> project as a subdirectory.
1521
+ We can do that in Git with <code>git read-tree</code>.
1522
+ You’ll learn more about <code>read-tree</code> and its friends in <a href="ch10-git-internals.html">Git Internals</a>, but for now know that it reads the root tree of one branch into your current staging area and working directory.
1523
+ We just switched back to your <code>master</code> branch, and we pull the <code>rack_branch</code> branch into the <code>rack</code> subdirectory of our <code>master</code> branch of our main project:</p>
1524
+ </div>
1525
+ <div class="listingblock">
1526
+ <div class="content">
1527
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git read-tree --prefix=rack/ -u rack_branch</code></pre>
1528
+ </div>
1529
+ </div>
1530
+ <div class="paragraph">
1531
+ <p>When we commit, it looks like we have all the Rack files under that subdirectory – as though we copied them in from a tarball.
1532
+ What gets interesting is that we can fairly easily merge changes from one of the branches to the other.
1533
+ So, if the Rack project updates, we can pull in upstream changes by switching to that branch and pulling:</p>
1534
+ </div>
1535
+ <div class="listingblock">
1536
+ <div class="content">
1537
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git checkout rack_branch
1538
+ $ git pull</code></pre>
1539
+ </div>
1540
+ </div>
1541
+ <div class="paragraph">
1542
+ <p>Then, we can merge those changes back into our <code>master</code> branch.
1543
+ To pull in the changes and prepopulate the commit message, use the <code>--squash</code> option, as well as the recursive merge strategy’s <code>-Xsubtree</code> option.
1544
+ The recursive strategy is the default here, but we include it for clarity.</p>
1545
+ </div>
1546
+ <div class="listingblock">
1547
+ <div class="content">
1548
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git checkout master
1549
+ $ git merge --squash -s recursive -Xsubtree=rack rack_branch
1550
+ Squash commit -- not updating HEAD
1551
+ Automatic merge went well; stopped before committing as requested</code></pre>
1552
+ </div>
1553
+ </div>
1554
+ <div class="paragraph">
1555
+ <p>All the changes from the Rack project are merged in and ready to be committed locally.
1556
+ You can also do the opposite – make changes in the <code>rack</code> subdirectory of your <code>master</code> branch and then merge them into your <code>rack_branch</code> branch later to submit them to the maintainers or push them upstream.</p>
1557
+ </div>
1558
+ <div class="paragraph">
1559
+ <p>This gives us a way to have a workflow somewhat similar to the submodule workflow without using submodules (which we will cover in <a href="_git_submodules.html">Submodules</a>).
1560
+ We can keep branches with other related projects in our repository and subtree merge them into our project occasionally.
1561
+ It is nice in some ways, for example all the code is committed to a single place.
1562
+ However, it has other drawbacks in that it’s a bit more complex and easier to make mistakes in reintegrating changes or accidentally pushing a branch into an unrelated repository.</p>
1563
+ </div>
1564
+ <div class="paragraph">
1565
+ <p>Another slightly weird thing is that to get a diff between what you have in your <code>rack</code> subdirectory and the code in your <code>rack_branch</code> branch – to see if you need to merge them – you can’t use the normal <code>diff</code> command.
1566
+ Instead, you must run <code>git diff-tree</code> with the branch you want to compare to:</p>
1567
+ </div>
1568
+ <div class="listingblock">
1569
+ <div class="content">
1570
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git diff-tree -p rack_branch</code></pre>
1571
+ </div>
1572
+ </div>
1573
+ <div class="paragraph">
1574
+ <p>Or, to compare what is in your <code>rack</code> subdirectory with what the <code>master</code> branch on the server was the last time you fetched, you can run:</p>
1575
+ </div>
1576
+ <div class="listingblock">
1577
+ <div class="content">
1578
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git diff-tree -p rack_remote/master</code></pre>
1579
+ </div>
1580
+ </div>
1581
+ </div>
1582
+ </div>
1583
+ <div id="nav"><a href="_the_index.html">prev</a> | <a href="ref_rerere.html">next</a></div></div>
1584
+ </div>
1585
+
1586
+ </div>
1587
+ </div>
1588
+ <footer>
1589
+ <div class="site-source">
1590
+ <a href="https://git-scm.com/site">About this site</a><br>
1591
+ Patches, suggestions, and comments are welcome.
1592
+ </div>
1593
+ <div class="sfc-member">
1594
+ Git is a member of <a href="https://git-scm.com/sfc">Software Freedom Conservancy</a>
1595
+ </div>
1596
+ </footer>
1597
+ <a href="_reverse_commit.html#top" class="no-js scrollToTop" id="scrollToTop" data-label="Scroll to top">
1598
+ <img src="../../../../images/icons/chevron-up@2x.png" width="20" height="20" alt="scroll-to-top"/>
1599
+ </a>
1600
+ <script src="../../../../assets/application-38b0d42ff05ffea45841edebbd14b75b89585646153808e82907c2c5c11f324b.js"></script>
1601
+
1602
+ </div>
1603
+
1604
+ </body>
1605
+ </html>