wayfarer 0.4.0 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (742) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yaml +1 -1
  3. data/.rubocop.yml +10 -0
  4. data/Gemfile.lock +21 -16
  5. data/docs/cookbook/batch_routing.md +22 -0
  6. data/docs/cookbook/consent_screen.md +36 -0
  7. data/docs/cookbook/executing_javascript.md +41 -0
  8. data/docs/cookbook/navigation.md +43 -0
  9. data/docs/cookbook/querying_html.md +3 -3
  10. data/docs/cookbook/screenshots.md +2 -2
  11. data/docs/cookbook/user_agent.md +1 -1
  12. data/docs/guides/callbacks.md +122 -15
  13. data/docs/guides/configuration.md +16 -10
  14. data/docs/guides/debugging.md +17 -0
  15. data/docs/guides/error_handling.md +22 -22
  16. data/docs/guides/jobs.md +44 -18
  17. data/docs/guides/navigation.md +73 -0
  18. data/docs/guides/networking/capybara.md +71 -0
  19. data/docs/guides/networking/custom_adapters.md +100 -0
  20. data/docs/guides/{browser_automation → networking}/ferrum.md +6 -4
  21. data/docs/guides/networking/http.md +33 -0
  22. data/docs/guides/{browser_automation → networking}/selenium.md +11 -7
  23. data/docs/guides/networking.md +77 -3
  24. data/docs/guides/pages.md +4 -4
  25. data/docs/guides/performance.md +108 -0
  26. data/docs/guides/reliability.md +41 -0
  27. data/docs/guides/routing/steering.md +30 -0
  28. data/docs/guides/tasks.md +9 -33
  29. data/docs/index.md +9 -1
  30. data/docs/reference/api/base.md +13 -127
  31. data/docs/reference/api/route.md +1 -1
  32. data/docs/reference/cli.md +0 -78
  33. data/docs/reference/configuration_keys.md +42 -0
  34. data/docs/reference/environment_variables.md +25 -27
  35. data/lib/wayfarer/base.rb +32 -32
  36. data/lib/wayfarer/callbacks.rb +71 -0
  37. data/lib/wayfarer/cli/base.rb +23 -1
  38. data/lib/wayfarer/cli/job.rb +7 -9
  39. data/lib/wayfarer/cli/route.rb +6 -4
  40. data/lib/wayfarer/cli/route_printer.rb +7 -7
  41. data/lib/wayfarer/cli/templates/job.rb.tt +3 -1
  42. data/lib/wayfarer/config/capybara.rb +10 -0
  43. data/lib/wayfarer/config/ferrum.rb +11 -0
  44. data/lib/wayfarer/config/networking.rb +26 -0
  45. data/lib/wayfarer/config/redis.rb +14 -0
  46. data/lib/wayfarer/config/root.rb +11 -0
  47. data/lib/wayfarer/config/selenium.rb +21 -0
  48. data/lib/wayfarer/config/strconv.rb +45 -0
  49. data/lib/wayfarer/config/struct.rb +72 -0
  50. data/lib/wayfarer/gc.rb +3 -8
  51. data/lib/wayfarer/handler.rb +15 -0
  52. data/lib/wayfarer/middleware/base.rb +19 -0
  53. data/lib/wayfarer/middleware/chain.rb +8 -0
  54. data/lib/wayfarer/middleware/controller.rb +40 -0
  55. data/lib/wayfarer/middleware/dedup.rb +5 -0
  56. data/lib/wayfarer/middleware/dispatch.rb +22 -0
  57. data/lib/wayfarer/middleware/fetch.rb +35 -11
  58. data/lib/wayfarer/middleware/lazy.rb +11 -0
  59. data/lib/wayfarer/middleware/normalize.rb +2 -0
  60. data/lib/wayfarer/middleware/router.rb +41 -3
  61. data/lib/wayfarer/middleware/stage.rb +6 -2
  62. data/lib/wayfarer/networking/capybara.rb +28 -0
  63. data/lib/wayfarer/networking/context.rb +37 -0
  64. data/lib/wayfarer/networking/ferrum.rb +18 -52
  65. data/lib/wayfarer/networking/follow.rb +22 -0
  66. data/lib/wayfarer/networking/http.rb +34 -0
  67. data/lib/wayfarer/networking/pool.rb +20 -14
  68. data/lib/wayfarer/networking/result.rb +1 -9
  69. data/lib/wayfarer/networking/selenium.rb +20 -47
  70. data/lib/wayfarer/networking/strategy.rb +38 -0
  71. data/lib/wayfarer/page.rb +3 -4
  72. data/lib/wayfarer/redis/pool.rb +3 -1
  73. data/lib/wayfarer/routing/dsl.rb +8 -8
  74. data/lib/wayfarer/routing/matchers/custom.rb +25 -0
  75. data/lib/wayfarer/routing/matchers/host.rb +21 -0
  76. data/lib/wayfarer/routing/matchers/path.rb +49 -0
  77. data/lib/wayfarer/routing/matchers/query.rb +63 -0
  78. data/lib/wayfarer/routing/matchers/scheme.rb +17 -0
  79. data/lib/wayfarer/routing/matchers/suffix.rb +17 -0
  80. data/lib/wayfarer/routing/matchers/url.rb +17 -0
  81. data/lib/wayfarer/routing/result.rb +0 -5
  82. data/lib/wayfarer/routing/route.rb +7 -1
  83. data/lib/wayfarer/routing/router.rb +28 -0
  84. data/lib/wayfarer/stringify.rb +13 -7
  85. data/lib/wayfarer/task.rb +4 -2
  86. data/lib/wayfarer.rb +5 -10
  87. data/spec/base_spec.rb +45 -40
  88. data/spec/callbacks_spec.rb +102 -0
  89. data/spec/cli/job_spec.rb +11 -7
  90. data/spec/config/capybara_spec.rb +18 -0
  91. data/spec/config/ferrum_spec.rb +24 -0
  92. data/spec/config/networking_spec.rb +73 -0
  93. data/spec/config/redis_spec.rb +32 -0
  94. data/spec/config/root_spec.rb +31 -0
  95. data/spec/config/selenium_spec.rb +56 -0
  96. data/spec/config/strconv_spec.rb +58 -0
  97. data/spec/config/struct_spec.rb +66 -0
  98. data/spec/factories/{queue/middleware.rb → middleware.rb} +3 -3
  99. data/spec/factories/{queue/page.rb → page.rb} +3 -3
  100. data/spec/factories/{queue/task.rb → task.rb} +0 -0
  101. data/spec/fixtures/dummy_job.rb +1 -1
  102. data/spec/gc_spec.rb +5 -7
  103. data/spec/handler_spec.rb +11 -0
  104. data/spec/integration/callbacks_spec.rb +85 -0
  105. data/spec/integration/page_spec.rb +62 -0
  106. data/spec/integration/params_spec.rb +56 -0
  107. data/spec/integration/stage_spec.rb +51 -0
  108. data/spec/integration/steering_spec.rb +57 -0
  109. data/spec/middleware/chain_spec.rb +32 -19
  110. data/spec/middleware/controller_spec.rb +86 -0
  111. data/spec/middleware/dedup_spec.rb +20 -8
  112. data/spec/middleware/dispatch_spec.rb +43 -0
  113. data/spec/middleware/fetch_spec.rb +117 -34
  114. data/spec/middleware/normalize_spec.rb +5 -4
  115. data/spec/middleware/router_spec.rb +82 -23
  116. data/spec/middleware/stage_spec.rb +42 -19
  117. data/spec/networking/capybara_spec.rb +12 -0
  118. data/spec/networking/context_spec.rb +127 -0
  119. data/spec/networking/ferrum_spec.rb +6 -22
  120. data/spec/networking/follow_spec.rb +41 -0
  121. data/spec/networking/http_spec.rb +12 -0
  122. data/spec/networking/pool_spec.rb +37 -12
  123. data/spec/networking/selenium_spec.rb +6 -22
  124. data/spec/networking/strategy.rb +170 -0
  125. data/spec/redis/pool_spec.rb +1 -1
  126. data/spec/routing/dsl_spec.rb +10 -10
  127. data/spec/routing/integration_spec.rb +22 -22
  128. data/spec/routing/{custom_matcher_spec.rb → matchers/custom_spec.rb} +4 -4
  129. data/spec/routing/{host_matcher_spec.rb → matchers/host_spec.rb} +6 -6
  130. data/spec/routing/{path_matcher_spec.rb → matchers/path_spec.rb} +6 -6
  131. data/spec/routing/{query_matcher_spec.rb → matchers/query_spec.rb} +15 -15
  132. data/spec/routing/{scheme_matcher_spec.rb → matchers/scheme_spec.rb} +4 -4
  133. data/spec/routing/{suffix_matcher_spec.rb → matchers/suffix_spec.rb} +4 -4
  134. data/spec/routing/{uri_matcher_spec.rb → matchers/uri_spec.rb} +4 -4
  135. data/spec/routing/path_finder_spec.rb +1 -1
  136. data/spec/routing/root_route_spec.rb +2 -2
  137. data/spec/routing/route_spec.rb +2 -2
  138. data/spec/routing/router_spec.rb +24 -0
  139. data/spec/spec_helpers.rb +24 -8
  140. data/spec/support/static/git-scm.com/assets/application-38b0d42ff05ffea45841edebbd14b75b89585646153808e82907c2c5c11f324b.js +772 -0
  141. data/spec/support/static/git-scm.com/assets/application-cafcf280f67db0e6d8168ba98a38da878769a9d5f37793b68ffb963a02d185e0.css +1 -0
  142. data/spec/support/static/git-scm.com/assets/modernize-b3ebe0c31c24f230dc62179d3e1030d2e57a53b1668d9382c0a27dbd44a94beb.js +20 -0
  143. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-Bash.html +751 -0
  144. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-PowerShell.html +804 -0
  145. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-Sublime-Text.html +728 -0
  146. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-Visual-Studio-Code.html +751 -0
  147. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-Visual-Studio.html +740 -0
  148. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Git-in-Zsh.html +765 -0
  149. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Graphical-Interfaces.html +931 -0
  150. data/spec/support/static/git-scm.com/book/en/v2/Appendix-A:-Git-in-Other-Environments-Summary.html +702 -0
  151. data/spec/support/static/git-scm.com/book/en/v2/Appendix-B:-Embedding-Git-in-your-Applications-Command-line-Git.html +720 -0
  152. data/spec/support/static/git-scm.com/book/en/v2/Appendix-B:-Embedding-Git-in-your-Applications-Dulwich.html +746 -0
  153. data/spec/support/static/git-scm.com/book/en/v2/Appendix-B:-Embedding-Git-in-your-Applications-JGit.html +889 -0
  154. data/spec/support/static/git-scm.com/book/en/v2/Appendix-B:-Embedding-Git-in-your-Applications-Libgit2.html +1003 -0
  155. data/spec/support/static/git-scm.com/book/en/v2/Appendix-B:-Embedding-Git-in-your-Applications-go-git.html +792 -0
  156. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Administration.html +745 -0
  157. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Basic-Snapshotting.html +840 -0
  158. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Branching-and-Merging.html +829 -0
  159. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Debugging.html +731 -0
  160. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Email.html +766 -0
  161. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-External-Systems.html +721 -0
  162. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Getting-and-Creating-Projects.html +746 -0
  163. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Inspection-and-Comparison.html +735 -0
  164. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Patching.html +742 -0
  165. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Plumbing-Commands.html +715 -0
  166. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Setup-and-Config.html +863 -0
  167. data/spec/support/static/git-scm.com/book/en/v2/Appendix-C:-Git-Commands-Sharing-and-Updating-Projects.html +802 -0
  168. data/spec/support/static/git-scm.com/book/en/v2/Customizing-Git-An-Example-Git-Enforced-Policy.html +1200 -0
  169. data/spec/support/static/git-scm.com/book/en/v2/Customizing-Git-Git-Attributes.html +1134 -0
  170. data/spec/support/static/git-scm.com/book/en/v2/Customizing-Git-Git-Configuration.html +1315 -0
  171. data/spec/support/static/git-scm.com/book/en/v2/Customizing-Git-Git-Hooks.html +876 -0
  172. data/spec/support/static/git-scm.com/book/en/v2/Customizing-Git-Summary.html +704 -0
  173. data/spec/support/static/git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project.html +1667 -0
  174. data/spec/support/static/git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows.html +859 -0
  175. data/spec/support/static/git-scm.com/book/en/v2/Distributed-Git-Maintaining-a-Project.html +1354 -0
  176. data/spec/support/static/git-scm.com/book/en/v2/Distributed-Git-Summary.html +704 -0
  177. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-A-Short-History-of-Git.html +735 -0
  178. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-About-Version-Control.html +783 -0
  179. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup.html +889 -0
  180. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-Getting-Help.html +750 -0
  181. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-Installing-Git.html +879 -0
  182. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-Summary.html +704 -0
  183. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-The-Command-Line.html +711 -0
  184. data/spec/support/static/git-scm.com/book/en/v2/Getting-Started-What-is-Git?.html +857 -0
  185. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository.html +816 -0
  186. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Git-Aliases.html +775 -0
  187. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository.html +1432 -0
  188. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Summary.html +703 -0
  189. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Tagging.html +1049 -0
  190. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Undoing-Things.html +998 -0
  191. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History.html +1172 -0
  192. data/spec/support/static/git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes.html +983 -0
  193. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging.html +1102 -0
  194. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Branch-Management.html +946 -0
  195. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell.html +1020 -0
  196. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Branching-Workflows.html +786 -0
  197. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Rebasing.html +1028 -0
  198. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Remote-Branches.html +1009 -0
  199. data/spec/support/static/git-scm.com/book/en/v2/Git-Branching-Summary.html +705 -0
  200. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Environment-Variables.html +1009 -0
  201. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Git-Objects.html +1209 -0
  202. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Git-References.html +939 -0
  203. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery.html +1086 -0
  204. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Packfiles.html +876 -0
  205. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain.html +745 -0
  206. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Summary.html +708 -0
  207. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-The-Refspec.html +872 -0
  208. data/spec/support/static/git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols.html +1043 -0
  209. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Advanced-Merging.html +1605 -0
  210. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Bundling.html +888 -0
  211. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Credential-Storage.html +1035 -0
  212. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git.html +861 -0
  213. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Interactive-Staging.html +920 -0
  214. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Replace.html +949 -0
  215. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Rerere.html +983 -0
  216. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Reset-Demystified.html +1236 -0
  217. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Revision-Selection.html +1178 -0
  218. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Rewriting-History.html +1182 -0
  219. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Searching.html +875 -0
  220. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work.html +922 -0
  221. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Stashing-and-Cleaning.html +1039 -0
  222. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Submodules.html +1864 -0
  223. data/spec/support/static/git-scm.com/book/en/v2/Git-Tools-Summary.html +705 -0
  224. data/spec/support/static/git-scm.com/book/en/v2/Git-and-Other-Systems-Git-as-a-Client.html +2656 -0
  225. data/spec/support/static/git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git.html +1741 -0
  226. data/spec/support/static/git-scm.com/book/en/v2/Git-and-Other-Systems-Summary.html +703 -0
  227. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key.html +759 -0
  228. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server.html +827 -0
  229. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Git-Daemon.html +775 -0
  230. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-GitLab.html +872 -0
  231. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-GitWeb.html +776 -0
  232. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server.html +870 -0
  233. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Smart-HTTP.html +789 -0
  234. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Summary.html +709 -0
  235. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols.html +963 -0
  236. data/spec/support/static/git-scm.com/book/en/v2/Git-on-the-Server-Third-Party-Hosted-Options.html +711 -0
  237. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Account-Setup-and-Configuration.html +858 -0
  238. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project.html +1502 -0
  239. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Maintaining-a-Project.html +1218 -0
  240. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Managing-an-organization.html +797 -0
  241. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Scripting-GitHub.html +1059 -0
  242. data/spec/support/static/git-scm.com/book/en/v2/GitHub-Summary.html +704 -0
  243. data/spec/support/static/git-scm.com/book/en/v2/ch00/_abort_merge.html +1605 -0
  244. data/spec/support/static/git-scm.com/book/en/v2/ch00/_add_email_addresses.html +858 -0
  245. data/spec/support/static/git-scm.com/book/en/v2/ch00/_advanced_merging.html +1605 -0
  246. data/spec/support/static/git-scm.com/book/en/v2/ch00/_an_example_git_enforced_policy.html +1200 -0
  247. data/spec/support/static/git-scm.com/book/en/v2/ch00/_annotated_tags.html +1049 -0
  248. data/spec/support/static/git-scm.com/book/en/v2/ch00/_api_comment.html +1059 -0
  249. data/spec/support/static/git-scm.com/book/en/v2/ch00/_bare_repo.html +827 -0
  250. data/spec/support/static/git-scm.com/book/en/v2/ch00/_basic_branching.html +1102 -0
  251. data/spec/support/static/git-scm.com/book/en/v2/ch00/_basic_merge_conflicts.html +1102 -0
  252. data/spec/support/static/git-scm.com/book/en/v2/ch00/_basic_merging.html +1102 -0
  253. data/spec/support/static/git-scm.com/book/en/v2/ch00/_binary_search.html +861 -0
  254. data/spec/support/static/git-scm.com/book/en/v2/ch00/_branch_management.html +946 -0
  255. data/spec/support/static/git-scm.com/book/en/v2/ch00/_branch_references.html +1178 -0
  256. data/spec/support/static/git-scm.com/book/en/v2/ch00/_build_number.html +1354 -0
  257. data/spec/support/static/git-scm.com/book/en/v2/ch00/_bundling.html +888 -0
  258. data/spec/support/static/git-scm.com/book/en/v2/ch00/_changing_multiple.html +1182 -0
  259. data/spec/support/static/git-scm.com/book/en/v2/ch00/_checking_out_conflicts.html +1605 -0
  260. data/spec/support/static/git-scm.com/book/en/v2/ch00/_checking_out_remotes.html +1354 -0
  261. data/spec/support/static/git-scm.com/book/en/v2/ch00/_checking_status.html +1432 -0
  262. data/spec/support/static/git-scm.com/book/en/v2/ch00/_cloning_submodules.html +1864 -0
  263. data/spec/support/static/git-scm.com/book/en/v2/ch00/_commit_guidelines.html +1667 -0
  264. data/spec/support/static/git-scm.com/book/en/v2/ch00/_commit_ranges.html +1178 -0
  265. data/spec/support/static/git-scm.com/book/en/v2/ch00/_commit_status.html +1059 -0
  266. data/spec/support/static/git-scm.com/book/en/v2/ch00/_committing_changes.html +1432 -0
  267. data/spec/support/static/git-scm.com/book/en/v2/ch00/_contrib_file.html +1218 -0
  268. data/spec/support/static/git-scm.com/book/en/v2/ch00/_contributing_project.html +1667 -0
  269. data/spec/support/static/git-scm.com/book/en/v2/ch00/_create_new_branch.html +1020 -0
  270. data/spec/support/static/git-scm.com/book/en/v2/ch00/_credential_caching.html +1035 -0
  271. data/spec/support/static/git-scm.com/book/en/v2/ch00/_custom_importer.html +1741 -0
  272. data/spec/support/static/git-scm.com/book/en/v2/ch00/_data_recovery.html +1086 -0
  273. data/spec/support/static/git-scm.com/book/en/v2/ch00/_delete_branches.html +1009 -0
  274. data/spec/support/static/git-scm.com/book/en/v2/ch00/_editor.html +889 -0
  275. data/spec/support/static/git-scm.com/book/en/v2/ch00/_eg_task_lists.html +1502 -0
  276. data/spec/support/static/git-scm.com/book/en/v2/ch00/_email_hooks.html +876 -0
  277. data/spec/support/static/git-scm.com/book/en/v2/ch00/_email_notification.html +1502 -0
  278. data/spec/support/static/git-scm.com/book/en/v2/ch00/_email_notifications.html +1218 -0
  279. data/spec/support/static/git-scm.com/book/en/v2/ch00/_email_pr.html +1218 -0
  280. data/spec/support/static/git-scm.com/book/en/v2/ch00/_enforcing_commit_message_format.html +1200 -0
  281. data/spec/support/static/git-scm.com/book/en/v2/ch00/_example_markdown.html +1502 -0
  282. data/spec/support/static/git-scm.com/book/en/v2/ch00/_external_merge_tools.html +1315 -0
  283. data/spec/support/static/git-scm.com/book/en/v2/ch00/_fetch_and_push_on_different_repositories.html +1502 -0
  284. data/spec/support/static/git-scm.com/book/en/v2/ch00/_fetching_and_pulling.html +983 -0
  285. data/spec/support/static/git-scm.com/book/en/v2/ch00/_file_annotation.html +861 -0
  286. data/spec/support/static/git-scm.com/book/en/v2/ch00/_first_time.html +889 -0
  287. data/spec/support/static/git-scm.com/book/en/v2/ch00/_generate_ssh_key.html +759 -0
  288. data/spec/support/static/git-scm.com/book/en/v2/ch00/_getting_a_repo.html +816 -0
  289. data/spec/support/static/git-scm.com/book/en/v2/ch00/_getting_git_on_a_server.html +827 -0
  290. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_aliases.html +775 -0
  291. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_am.html +1354 -0
  292. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_amend.html +1182 -0
  293. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_branches_overview.html +1020 -0
  294. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_clean.html +1039 -0
  295. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_cloning.html +816 -0
  296. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_commit_objects.html +1209 -0
  297. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_config.html +1315 -0
  298. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_diff_staged.html +1432 -0
  299. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_gc.html +1086 -0
  300. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_grep.html +875 -0
  301. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_help.html +750 -0
  302. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_hooks.html +876 -0
  303. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_mv.html +1432 -0
  304. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_p4.html +1741 -0
  305. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_p4_branches.html +2656 -0
  306. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_reflog.html +1178 -0
  307. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_refs.html +939 -0
  308. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_reset.html +1236 -0
  309. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_stashing.html +1039 -0
  310. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_submodules.html +1864 -0
  311. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_svn.html +2656 -0
  312. data/spec/support/static/git-scm.com/book/en/v2/ch00/_git_tagging.html +1049 -0
  313. data/spec/support/static/git-scm.com/book/en/v2/ch00/_gitlab_groups_section.html +872 -0
  314. data/spec/support/static/git-scm.com/book/en/v2/ch00/_ignoring.html +1432 -0
  315. data/spec/support/static/git-scm.com/book/en/v2/ch00/_inspecting_remote.html +983 -0
  316. data/spec/support/static/git-scm.com/book/en/v2/ch00/_integration_manager.html +859 -0
  317. data/spec/support/static/git-scm.com/book/en/v2/ch00/_interactive_staging.html +920 -0
  318. data/spec/support/static/git-scm.com/book/en/v2/ch00/_keyword_expansion.html +1134 -0
  319. data/spec/support/static/git-scm.com/book/en/v2/ch00/_libgit2_bindings.html +1003 -0
  320. data/spec/support/static/git-scm.com/book/en/v2/ch00/_manual_remerge.html +1605 -0
  321. data/spec/support/static/git-scm.com/book/en/v2/ch00/_md_code.html +1502 -0
  322. data/spec/support/static/git-scm.com/book/en/v2/ch00/_md_drag.html +1502 -0
  323. data/spec/support/static/git-scm.com/book/en/v2/ch00/_md_emoji.html +1502 -0
  324. data/spec/support/static/git-scm.com/book/en/v2/ch00/_md_quote.html +1502 -0
  325. data/spec/support/static/git-scm.com/book/en/v2/ch00/_merge_button.html +1218 -0
  326. data/spec/support/static/git-scm.com/book/en/v2/ch00/_merge_log.html +1605 -0
  327. data/spec/support/static/git-scm.com/book/en/v2/ch00/_merge_rebase_work.html +1028 -0
  328. data/spec/support/static/git-scm.com/book/en/v2/ch00/_new_repo_dropdown.html +1218 -0
  329. data/spec/support/static/git-scm.com/book/en/v2/ch00/_not_center.html +1218 -0
  330. data/spec/support/static/git-scm.com/book/en/v2/ch00/_org_page.html +797 -0
  331. data/spec/support/static/git-scm.com/book/en/v2/ch00/_other_client_hooks.html +876 -0
  332. data/spec/support/static/git-scm.com/book/en/v2/ch00/_p4_git_fusion.html +2656 -0
  333. data/spec/support/static/git-scm.com/book/en/v2/ch00/_patches_from_email.html +1354 -0
  334. data/spec/support/static/git-scm.com/book/en/v2/ch00/_personal_avatar.html +858 -0
  335. data/spec/support/static/git-scm.com/book/en/v2/ch00/_plumbing_porcelain.html +745 -0
  336. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_closed.html +1502 -0
  337. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_discussion.html +1502 -0
  338. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_fail.html +1502 -0
  339. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_final.html +1502 -0
  340. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_references.html +1502 -0
  341. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_references_render.html +1502 -0
  342. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pr_refs.html +1218 -0
  343. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pre_merge_rebase_work.html +1028 -0
  344. data/spec/support/static/git-scm.com/book/en/v2/ch00/_preparing_release.html +1354 -0
  345. data/spec/support/static/git-scm.com/book/en/v2/ch00/_private_team.html +1667 -0
  346. data/spec/support/static/git-scm.com/book/en/v2/ch00/_project_over_email.html +1667 -0
  347. data/spec/support/static/git-scm.com/book/en/v2/ch00/_public_project.html +1667 -0
  348. data/spec/support/static/git-scm.com/book/en/v2/ch00/_publishing_submodules.html +1864 -0
  349. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pushing_branches.html +1009 -0
  350. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pushing_refspecs.html +872 -0
  351. data/spec/support/static/git-scm.com/book/en/v2/ch00/_pushing_remotes.html +983 -0
  352. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rebase_cherry_pick.html +1354 -0
  353. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rebase_peril.html +1028 -0
  354. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rebase_rebase.html +1028 -0
  355. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rebase_rebase_work.html +1028 -0
  356. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rebasing.html +1028 -0
  357. data/spec/support/static/git-scm.com/book/en/v2/ch00/_refspec.html +872 -0
  358. data/spec/support/static/git-scm.com/book/en/v2/ch00/_remote_branches.html +1009 -0
  359. data/spec/support/static/git-scm.com/book/en/v2/ch00/_remote_repos.html +983 -0
  360. data/spec/support/static/git-scm.com/book/en/v2/ch00/_removing_file_every_commit.html +1182 -0
  361. data/spec/support/static/git-scm.com/book/en/v2/ch00/_removing_files.html +1432 -0
  362. data/spec/support/static/git-scm.com/book/en/v2/ch00/_removing_objects.html +1086 -0
  363. data/spec/support/static/git-scm.com/book/en/v2/ch00/_replace.html +949 -0
  364. data/spec/support/static/git-scm.com/book/en/v2/ch00/_reverse_commit.html +1605 -0
  365. data/spec/support/static/git-scm.com/book/en/v2/ch00/_revision_selection.html +1178 -0
  366. data/spec/support/static/git-scm.com/book/en/v2/ch00/_rewriting_history.html +1182 -0
  367. data/spec/support/static/git-scm.com/book/en/v2/ch00/_searching.html +875 -0
  368. data/spec/support/static/git-scm.com/book/en/v2/ch00/_service_config.html +1059 -0
  369. data/spec/support/static/git-scm.com/book/en/v2/ch00/_services_hooks.html +1059 -0
  370. data/spec/support/static/git-scm.com/book/en/v2/ch00/_setting_up_server.html +870 -0
  371. data/spec/support/static/git-scm.com/book/en/v2/ch00/_sharing_tags.html +1049 -0
  372. data/spec/support/static/git-scm.com/book/en/v2/ch00/_signing.html +922 -0
  373. data/spec/support/static/git-scm.com/book/en/v2/ch00/_signing_commits.html +922 -0
  374. data/spec/support/static/git-scm.com/book/en/v2/ch00/_squashing.html +1182 -0
  375. data/spec/support/static/git-scm.com/book/en/v2/ch00/_starting_submodules.html +1864 -0
  376. data/spec/support/static/git-scm.com/book/en/v2/ch00/_subtree_merge.html +1605 -0
  377. data/spec/support/static/git-scm.com/book/en/v2/ch00/_switching_branches.html +1020 -0
  378. data/spec/support/static/git-scm.com/book/en/v2/ch00/_tagging_releases.html +1354 -0
  379. data/spec/support/static/git-scm.com/book/en/v2/ch00/_task_list_progress.html +1502 -0
  380. data/spec/support/static/git-scm.com/book/en/v2/ch00/_team_page.html +797 -0
  381. data/spec/support/static/git-scm.com/book/en/v2/ch00/_the_index.html +1236 -0
  382. data/spec/support/static/git-scm.com/book/en/v2/ch00/_the_shortlog.html +1354 -0
  383. data/spec/support/static/git-scm.com/book/en/v2/ch00/_topic_branch.html +786 -0
  384. data/spec/support/static/git-scm.com/book/en/v2/ch00/_tracking_branches.html +1009 -0
  385. data/spec/support/static/git-scm.com/book/en/v2/ch00/_tracking_files.html +1432 -0
  386. data/spec/support/static/git-scm.com/book/en/v2/ch00/_tree_objects.html +1209 -0
  387. data/spec/support/static/git-scm.com/book/en/v2/ch00/_triple_dot.html +1178 -0
  388. data/spec/support/static/git-scm.com/book/en/v2/ch00/_undoing.html +998 -0
  389. data/spec/support/static/git-scm.com/book/en/v2/ch00/_unstaging.html +998 -0
  390. data/spec/support/static/git-scm.com/book/en/v2/ch00/_viewing_history.html +1172 -0
  391. data/spec/support/static/git-scm.com/book/en/v2/ch00/_web_hook.html +1059 -0
  392. data/spec/support/static/git-scm.com/book/en/v2/ch00/_what_is_introduced.html +1354 -0
  393. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch01-getting-started.html +783 -0
  394. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch02-git-basics-chapter.html +816 -0
  395. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch03-git-branching.html +1020 -0
  396. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch05-distributed-git.html +859 -0
  397. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch06-github.html +858 -0
  398. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch06-github_flow.html +1502 -0
  399. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch10-git-internals.html +745 -0
  400. data/spec/support/static/git-scm.com/book/en/v2/ch00/ch_core_editor.html +863 -0
  401. data/spec/support/static/git-scm.com/book/en/v2/ch00/divergent_history.html +1020 -0
  402. data/spec/support/static/git-scm.com/book/en/v2/ch00/double_dot.html +1178 -0
  403. data/spec/support/static/git-scm.com/book/en/v2/ch00/filters_a.html +1134 -0
  404. data/spec/support/static/git-scm.com/book/en/v2/ch00/filters_b.html +1134 -0
  405. data/spec/support/static/git-scm.com/book/en/v2/ch00/limit_options.html +1172 -0
  406. data/spec/support/static/git-scm.com/book/en/v2/ch00/log_options.html +1172 -0
  407. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_a.html +1354 -0
  408. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_b.html +1354 -0
  409. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_c.html +1354 -0
  410. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_d.html +1354 -0
  411. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_e.html +1354 -0
  412. data/spec/support/static/git-scm.com/book/en/v2/ch00/merwf_f.html +1354 -0
  413. data/spec/support/static/git-scm.com/book/en/v2/ch00/oh_my_zsh_git.html +765 -0
  414. data/spec/support/static/git-scm.com/book/en/v2/ch00/pretty_format.html +1172 -0
  415. data/spec/support/static/git-scm.com/book/en/v2/ch00/psp_b.html +1667 -0
  416. data/spec/support/static/git-scm.com/book/en/v2/ch00/rbdiag_e.html +1028 -0
  417. data/spec/support/static/git-scm.com/book/en/v2/ch00/rbdiag_g.html +1028 -0
  418. data/spec/support/static/git-scm.com/book/en/v2/ch00/rbdiag_h.html +1028 -0
  419. data/spec/support/static/git-scm.com/book/en/v2/ch00/rbdiag_i.html +1028 -0
  420. data/spec/support/static/git-scm.com/book/en/v2/ch00/rebasing-merging-example.html +1028 -0
  421. data/spec/support/static/git-scm.com/book/en/v2/ch00/ref_rerere.html +983 -0
  422. data/spec/support/static/git-scm.com/book/en/v2/ch00/ref_the_ref.html +939 -0
  423. data/spec/support/static/git-scm.com/book/en/v2/ch00/wfdiag_b.html +859 -0
  424. data/spec/support/static/git-scm.com/book/en/v2/ch00/wfdiag_c.html +859 -0
  425. data/spec/support/static/git-scm.com/book/en/v2/ch00/what_is_git_section.html +857 -0
  426. data/spec/support/static/git-scm.com/book/en/v2/images/2fa-1.png +0 -0
  427. data/spec/support/static/git-scm.com/book/en/v2/images/account-settings.png +0 -0
  428. data/spec/support/static/git-scm.com/book/en/v2/images/advance-master.png +0 -0
  429. data/spec/support/static/git-scm.com/book/en/v2/images/advance-testing.png +0 -0
  430. data/spec/support/static/git-scm.com/book/en/v2/images/areas.png +0 -0
  431. data/spec/support/static/git-scm.com/book/en/v2/images/avatar-crop.png +0 -0
  432. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-1.png +0 -0
  433. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-2.png +0 -0
  434. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-3.png +0 -0
  435. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-4.png +0 -0
  436. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-5.png +0 -0
  437. data/spec/support/static/git-scm.com/book/en/v2/images/basic-branching-6.png +0 -0
  438. data/spec/support/static/git-scm.com/book/en/v2/images/basic-merging-1.png +0 -0
  439. data/spec/support/static/git-scm.com/book/en/v2/images/basic-merging-2.png +0 -0
  440. data/spec/support/static/git-scm.com/book/en/v2/images/basic-rebase-1.png +0 -0
  441. data/spec/support/static/git-scm.com/book/en/v2/images/basic-rebase-2.png +0 -0
  442. data/spec/support/static/git-scm.com/book/en/v2/images/basic-rebase-3.png +0 -0
  443. data/spec/support/static/git-scm.com/book/en/v2/images/basic-rebase-4.png +0 -0
  444. data/spec/support/static/git-scm.com/book/en/v2/images/benevolent-dictator.png +0 -0
  445. data/spec/support/static/git-scm.com/book/en/v2/images/blink-01-start.png +0 -0
  446. data/spec/support/static/git-scm.com/book/en/v2/images/blink-02-pr.png +0 -0
  447. data/spec/support/static/git-scm.com/book/en/v2/images/blink-03-pull-request-open.png +0 -0
  448. data/spec/support/static/git-scm.com/book/en/v2/images/blink-04-email.png +0 -0
  449. data/spec/support/static/git-scm.com/book/en/v2/images/blink-04-pr-comment.png +0 -0
  450. data/spec/support/static/git-scm.com/book/en/v2/images/blink-05-general-comment.png +0 -0
  451. data/spec/support/static/git-scm.com/book/en/v2/images/blink-06-final.png +0 -0
  452. data/spec/support/static/git-scm.com/book/en/v2/images/branch-and-history.png +0 -0
  453. data/spec/support/static/git-scm.com/book/en/v2/images/branch_widget_mac.png +0 -0
  454. data/spec/support/static/git-scm.com/book/en/v2/images/branch_widget_win.png +0 -0
  455. data/spec/support/static/git-scm.com/book/en/v2/images/centralized.png +0 -0
  456. data/spec/support/static/git-scm.com/book/en/v2/images/centralized_workflow.png +0 -0
  457. data/spec/support/static/git-scm.com/book/en/v2/images/checkout-master.png +0 -0
  458. data/spec/support/static/git-scm.com/book/en/v2/images/clean.png +0 -0
  459. data/spec/support/static/git-scm.com/book/en/v2/images/collaborators.png +0 -0
  460. data/spec/support/static/git-scm.com/book/en/v2/images/commit-and-tree.png +0 -0
  461. data/spec/support/static/git-scm.com/book/en/v2/images/commits-and-parents.png +0 -0
  462. data/spec/support/static/git-scm.com/book/en/v2/images/data-model-1.png +0 -0
  463. data/spec/support/static/git-scm.com/book/en/v2/images/data-model-2.png +0 -0
  464. data/spec/support/static/git-scm.com/book/en/v2/images/data-model-3.png +0 -0
  465. data/spec/support/static/git-scm.com/book/en/v2/images/data-model-4.png +0 -0
  466. data/spec/support/static/git-scm.com/book/en/v2/images/deltas.png +0 -0
  467. data/spec/support/static/git-scm.com/book/en/v2/images/distributed.png +0 -0
  468. data/spec/support/static/git-scm.com/book/en/v2/images/double-dot.png +0 -0
  469. data/spec/support/static/git-scm.com/book/en/v2/images/email-settings.png +0 -0
  470. data/spec/support/static/git-scm.com/book/en/v2/images/forkbutton.png +0 -0
  471. data/spec/support/static/git-scm.com/book/en/v2/images/git-bash.png +0 -0
  472. data/spec/support/static/git-scm.com/book/en/v2/images/git-diff-check.png +0 -0
  473. data/spec/support/static/git-scm.com/book/en/v2/images/git-fusion-boot.png +0 -0
  474. data/spec/support/static/git-scm.com/book/en/v2/images/git-fusion-perforce-graph.png +0 -0
  475. data/spec/support/static/git-scm.com/book/en/v2/images/git-gui.png +0 -0
  476. data/spec/support/static/git-scm.com/book/en/v2/images/git-instaweb.png +0 -0
  477. data/spec/support/static/git-scm.com/book/en/v2/images/git-osx-installer.png +0 -0
  478. data/spec/support/static/git-scm.com/book/en/v2/images/github_mac.png +0 -0
  479. data/spec/support/static/git-scm.com/book/en/v2/images/github_win.png +0 -0
  480. data/spec/support/static/git-scm.com/book/en/v2/images/gitk.png +0 -0
  481. data/spec/support/static/git-scm.com/book/en/v2/images/gitlab-groups.png +0 -0
  482. data/spec/support/static/git-scm.com/book/en/v2/images/gitlab-menu.png +0 -0
  483. data/spec/support/static/git-scm.com/book/en/v2/images/gitlab-users.png +0 -0
  484. data/spec/support/static/git-scm.com/book/en/v2/images/head-to-master.png +0 -0
  485. data/spec/support/static/git-scm.com/book/en/v2/images/head-to-testing.png +0 -0
  486. data/spec/support/static/git-scm.com/book/en/v2/images/integration-manager.png +0 -0
  487. data/spec/support/static/git-scm.com/book/en/v2/images/interesting-rebase-1.png +0 -0
  488. data/spec/support/static/git-scm.com/book/en/v2/images/interesting-rebase-2.png +0 -0
  489. data/spec/support/static/git-scm.com/book/en/v2/images/interesting-rebase-3.png +0 -0
  490. data/spec/support/static/git-scm.com/book/en/v2/images/interesting-rebase-4.png +0 -0
  491. data/spec/support/static/git-scm.com/book/en/v2/images/interesting-rebase-5.png +0 -0
  492. data/spec/support/static/git-scm.com/book/en/v2/images/jb.png +0 -0
  493. data/spec/support/static/git-scm.com/book/en/v2/images/large-merges-1.png +0 -0
  494. data/spec/support/static/git-scm.com/book/en/v2/images/large-merges-2.png +0 -0
  495. data/spec/support/static/git-scm.com/book/en/v2/images/lifecycle.png +0 -0
  496. data/spec/support/static/git-scm.com/book/en/v2/images/local.png +0 -0
  497. data/spec/support/static/git-scm.com/book/en/v2/images/lr-branches-1.png +0 -0
  498. data/spec/support/static/git-scm.com/book/en/v2/images/lr-branches-2.png +0 -0
  499. data/spec/support/static/git-scm.com/book/en/v2/images/maint-01-email.png +0 -0
  500. data/spec/support/static/git-scm.com/book/en/v2/images/maint-02-merge.png +0 -0
  501. data/spec/support/static/git-scm.com/book/en/v2/images/maint-03-email-resp.png +0 -0
  502. data/spec/support/static/git-scm.com/book/en/v2/images/maint-04-target.png +0 -0
  503. data/spec/support/static/git-scm.com/book/en/v2/images/maint-05-mentions.png +0 -0
  504. data/spec/support/static/git-scm.com/book/en/v2/images/maint-06-unsubscribe.png +0 -0
  505. data/spec/support/static/git-scm.com/book/en/v2/images/maint-07-notifications.png +0 -0
  506. data/spec/support/static/git-scm.com/book/en/v2/images/maint-08-notifications-page.png +0 -0
  507. data/spec/support/static/git-scm.com/book/en/v2/images/maint-09-contrib.png +0 -0
  508. data/spec/support/static/git-scm.com/book/en/v2/images/maint-10-default-branch.png +0 -0
  509. data/spec/support/static/git-scm.com/book/en/v2/images/maint-11-transfer.png +0 -0
  510. data/spec/support/static/git-scm.com/book/en/v2/images/managed-team-1.png +0 -0
  511. data/spec/support/static/git-scm.com/book/en/v2/images/managed-team-2.png +0 -0
  512. data/spec/support/static/git-scm.com/book/en/v2/images/managed-team-3.png +0 -0
  513. data/spec/support/static/git-scm.com/book/en/v2/images/managed-team-flow.png +0 -0
  514. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-01-example.png +0 -0
  515. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-02-tasks.png +0 -0
  516. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-03-task-summary.png +0 -0
  517. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-04-fenced-code.png +0 -0
  518. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-05-quote.png +0 -0
  519. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-06-emoji-complete.png +0 -0
  520. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-07-emoji.png +0 -0
  521. data/spec/support/static/git-scm.com/book/en/v2/images/markdown-08-drag-drop.png +0 -0
  522. data/spec/support/static/git-scm.com/book/en/v2/images/mentions-01-syntax.png +0 -0
  523. data/spec/support/static/git-scm.com/book/en/v2/images/mentions-02-render.png +0 -0
  524. data/spec/support/static/git-scm.com/book/en/v2/images/mentions-03-closed.png +0 -0
  525. data/spec/support/static/git-scm.com/book/en/v2/images/merging-workflows-1.png +0 -0
  526. data/spec/support/static/git-scm.com/book/en/v2/images/merging-workflows-2.png +0 -0
  527. data/spec/support/static/git-scm.com/book/en/v2/images/merging-workflows-3.png +0 -0
  528. data/spec/support/static/git-scm.com/book/en/v2/images/merging-workflows-4.png +0 -0
  529. data/spec/support/static/git-scm.com/book/en/v2/images/merging-workflows-5.png +0 -0
  530. data/spec/support/static/git-scm.com/book/en/v2/images/new-repo.png +0 -0
  531. data/spec/support/static/git-scm.com/book/en/v2/images/neworg.png +0 -0
  532. data/spec/support/static/git-scm.com/book/en/v2/images/newrepo.png +0 -0
  533. data/spec/support/static/git-scm.com/book/en/v2/images/newrepoform.png +0 -0
  534. data/spec/support/static/git-scm.com/book/en/v2/images/orgs-01-page.png +0 -0
  535. data/spec/support/static/git-scm.com/book/en/v2/images/orgs-02-teams.png +0 -0
  536. data/spec/support/static/git-scm.com/book/en/v2/images/orgs-03-audit.png +0 -0
  537. data/spec/support/static/git-scm.com/book/en/v2/images/p4merge.png +0 -0
  538. data/spec/support/static/git-scm.com/book/en/v2/images/perils-of-rebasing-1.png +0 -0
  539. data/spec/support/static/git-scm.com/book/en/v2/images/perils-of-rebasing-2.png +0 -0
  540. data/spec/support/static/git-scm.com/book/en/v2/images/perils-of-rebasing-3.png +0 -0
  541. data/spec/support/static/git-scm.com/book/en/v2/images/perils-of-rebasing-4.png +0 -0
  542. data/spec/support/static/git-scm.com/book/en/v2/images/perils-of-rebasing-5.png +0 -0
  543. data/spec/support/static/git-scm.com/book/en/v2/images/posh-git.png +0 -0
  544. data/spec/support/static/git-scm.com/book/en/v2/images/pr-01-fail.png +0 -0
  545. data/spec/support/static/git-scm.com/book/en/v2/images/pr-02-merge-fix.png +0 -0
  546. data/spec/support/static/git-scm.com/book/en/v2/images/public-small-1.png +0 -0
  547. data/spec/support/static/git-scm.com/book/en/v2/images/public-small-2.png +0 -0
  548. data/spec/support/static/git-scm.com/book/en/v2/images/public-small-3.png +0 -0
  549. data/spec/support/static/git-scm.com/book/en/v2/images/rebasing-1.png +0 -0
  550. data/spec/support/static/git-scm.com/book/en/v2/images/rebasing-2.png +0 -0
  551. data/spec/support/static/git-scm.com/book/en/v2/images/remote-branches-1.png +0 -0
  552. data/spec/support/static/git-scm.com/book/en/v2/images/remote-branches-2.png +0 -0
  553. data/spec/support/static/git-scm.com/book/en/v2/images/remote-branches-3.png +0 -0
  554. data/spec/support/static/git-scm.com/book/en/v2/images/remote-branches-4.png +0 -0
  555. data/spec/support/static/git-scm.com/book/en/v2/images/remote-branches-5.png +0 -0
  556. data/spec/support/static/git-scm.com/book/en/v2/images/replace1.png +0 -0
  557. data/spec/support/static/git-scm.com/book/en/v2/images/replace2.png +0 -0
  558. data/spec/support/static/git-scm.com/book/en/v2/images/replace3.png +0 -0
  559. data/spec/support/static/git-scm.com/book/en/v2/images/replace4.png +0 -0
  560. data/spec/support/static/git-scm.com/book/en/v2/images/replace5.png +0 -0
  561. data/spec/support/static/git-scm.com/book/en/v2/images/reposettingslink.png +0 -0
  562. data/spec/support/static/git-scm.com/book/en/v2/images/rerere1.png +0 -0
  563. data/spec/support/static/git-scm.com/book/en/v2/images/rerere2.png +0 -0
  564. data/spec/support/static/git-scm.com/book/en/v2/images/rerere3.png +0 -0
  565. data/spec/support/static/git-scm.com/book/en/v2/images/reset-checkout.png +0 -0
  566. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex1.png +0 -0
  567. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex2.png +0 -0
  568. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex3.png +0 -0
  569. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex4.png +0 -0
  570. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex5.png +0 -0
  571. data/spec/support/static/git-scm.com/book/en/v2/images/reset-ex6.png +0 -0
  572. data/spec/support/static/git-scm.com/book/en/v2/images/reset-hard.png +0 -0
  573. data/spec/support/static/git-scm.com/book/en/v2/images/reset-mixed.png +0 -0
  574. data/spec/support/static/git-scm.com/book/en/v2/images/reset-path1.png +0 -0
  575. data/spec/support/static/git-scm.com/book/en/v2/images/reset-path2.png +0 -0
  576. data/spec/support/static/git-scm.com/book/en/v2/images/reset-path3.png +0 -0
  577. data/spec/support/static/git-scm.com/book/en/v2/images/reset-soft.png +0 -0
  578. data/spec/support/static/git-scm.com/book/en/v2/images/reset-squash-r1.png +0 -0
  579. data/spec/support/static/git-scm.com/book/en/v2/images/reset-squash-r2.png +0 -0
  580. data/spec/support/static/git-scm.com/book/en/v2/images/reset-squash-r3.png +0 -0
  581. data/spec/support/static/git-scm.com/book/en/v2/images/reset-start.png +0 -0
  582. data/spec/support/static/git-scm.com/book/en/v2/images/reset-workflow.png +0 -0
  583. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-01-services.png +0 -0
  584. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-02-email-service.png +0 -0
  585. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-03-webhook.png +0 -0
  586. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-04-webhook-debug.png +0 -0
  587. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-05-access-token.png +0 -0
  588. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-06-comment.png +0 -0
  589. data/spec/support/static/git-scm.com/book/en/v2/images/scripting-07-status.png +0 -0
  590. data/spec/support/static/git-scm.com/book/en/v2/images/signup.png +0 -0
  591. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-1.png +0 -0
  592. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-2.png +0 -0
  593. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-3.png +0 -0
  594. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-4.png +0 -0
  595. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-5.png +0 -0
  596. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-6.png +0 -0
  597. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-7.png +0 -0
  598. data/spec/support/static/git-scm.com/book/en/v2/images/small-team-flow.png +0 -0
  599. data/spec/support/static/git-scm.com/book/en/v2/images/smudge.png +0 -0
  600. data/spec/support/static/git-scm.com/book/en/v2/images/snapshots.png +0 -0
  601. data/spec/support/static/git-scm.com/book/en/v2/images/ssh-keys.png +0 -0
  602. data/spec/support/static/git-scm.com/book/en/v2/images/topic-branches-1.png +0 -0
  603. data/spec/support/static/git-scm.com/book/en/v2/images/topic-branches-2.png +0 -0
  604. data/spec/support/static/git-scm.com/book/en/v2/images/two-branches.png +0 -0
  605. data/spec/support/static/git-scm.com/book/en/v2/images/undomerge-reset.png +0 -0
  606. data/spec/support/static/git-scm.com/book/en/v2/images/undomerge-revert.png +0 -0
  607. data/spec/support/static/git-scm.com/book/en/v2/images/undomerge-revert2.png +0 -0
  608. data/spec/support/static/git-scm.com/book/en/v2/images/undomerge-revert3.png +0 -0
  609. data/spec/support/static/git-scm.com/book/en/v2/images/undomerge-start.png +0 -0
  610. data/spec/support/static/git-scm.com/book/en/v2/images/your-profile.png +0 -0
  611. data/spec/support/static/git-scm.com/book/en/v2/images/zsh-oh-my.png +0 -0
  612. data/spec/support/static/git-scm.com/book/en/v2/images/zsh-prompt.png +0 -0
  613. data/spec/support/static/git-scm.com/book/en/v2.html +688 -0
  614. data/spec/support/static/git-scm.com/favicon.ico +0 -0
  615. data/spec/support/static/git-scm.com/images/bg/body.jpg +0 -0
  616. data/spec/support/static/git-scm.com/images/bg/isometric-grid.png +0 -0
  617. data/spec/support/static/git-scm.com/images/bg/isometric-grid@2x.png +0 -0
  618. data/spec/support/static/git-scm.com/images/bg/search-header.jpg +0 -0
  619. data/spec/support/static/git-scm.com/images/company-project-logos/android.png +0 -0
  620. data/spec/support/static/git-scm.com/images/company-project-logos/android@2x.png +0 -0
  621. data/spec/support/static/git-scm.com/images/company-project-logos/eclipse.png +0 -0
  622. data/spec/support/static/git-scm.com/images/company-project-logos/eclipse@2x.png +0 -0
  623. data/spec/support/static/git-scm.com/images/company-project-logos/facebook.png +0 -0
  624. data/spec/support/static/git-scm.com/images/company-project-logos/facebook@2x.png +0 -0
  625. data/spec/support/static/git-scm.com/images/company-project-logos/gnome.png +0 -0
  626. data/spec/support/static/git-scm.com/images/company-project-logos/gnome@2x.png +0 -0
  627. data/spec/support/static/git-scm.com/images/company-project-logos/google.png +0 -0
  628. data/spec/support/static/git-scm.com/images/company-project-logos/google@2x.png +0 -0
  629. data/spec/support/static/git-scm.com/images/company-project-logos/kde.png +0 -0
  630. data/spec/support/static/git-scm.com/images/company-project-logos/kde@2x.png +0 -0
  631. data/spec/support/static/git-scm.com/images/company-project-logos/linked-in.png +0 -0
  632. data/spec/support/static/git-scm.com/images/company-project-logos/linked-in@2x.png +0 -0
  633. data/spec/support/static/git-scm.com/images/company-project-logos/linux.png +0 -0
  634. data/spec/support/static/git-scm.com/images/company-project-logos/linux@2x.png +0 -0
  635. data/spec/support/static/git-scm.com/images/company-project-logos/microsoft.png +0 -0
  636. data/spec/support/static/git-scm.com/images/company-project-logos/microsoft@2x.png +0 -0
  637. data/spec/support/static/git-scm.com/images/company-project-logos/netflix.png +0 -0
  638. data/spec/support/static/git-scm.com/images/company-project-logos/netflix@2x.png +0 -0
  639. data/spec/support/static/git-scm.com/images/company-project-logos/perl.png +0 -0
  640. data/spec/support/static/git-scm.com/images/company-project-logos/perl@2x.png +0 -0
  641. data/spec/support/static/git-scm.com/images/company-project-logos/postgresql.png +0 -0
  642. data/spec/support/static/git-scm.com/images/company-project-logos/postgresql@2x.png +0 -0
  643. data/spec/support/static/git-scm.com/images/company-project-logos/qt.png +0 -0
  644. data/spec/support/static/git-scm.com/images/company-project-logos/qt@2x.png +0 -0
  645. data/spec/support/static/git-scm.com/images/company-project-logos/rails.png +0 -0
  646. data/spec/support/static/git-scm.com/images/company-project-logos/rails@2x.png +0 -0
  647. data/spec/support/static/git-scm.com/images/company-project-logos/twitter.png +0 -0
  648. data/spec/support/static/git-scm.com/images/company-project-logos/twitter@2x.png +0 -0
  649. data/spec/support/static/git-scm.com/images/company-project-logos/x.png +0 -0
  650. data/spec/support/static/git-scm.com/images/company-project-logos/x@2x.png +0 -0
  651. data/spec/support/static/git-scm.com/images/epub.png +0 -0
  652. data/spec/support/static/git-scm.com/images/icons/admin-sm.png +0 -0
  653. data/spec/support/static/git-scm.com/images/icons/admin-sm@2x.png +0 -0
  654. data/spec/support/static/git-scm.com/images/icons/apple.png +0 -0
  655. data/spec/support/static/git-scm.com/images/icons/apple@2x.png +0 -0
  656. data/spec/support/static/git-scm.com/images/icons/book.png +0 -0
  657. data/spec/support/static/git-scm.com/images/icons/book@2x.png +0 -0
  658. data/spec/support/static/git-scm.com/images/icons/box.png +0 -0
  659. data/spec/support/static/git-scm.com/images/icons/box@2x.png +0 -0
  660. data/spec/support/static/git-scm.com/images/icons/branch-sm.png +0 -0
  661. data/spec/support/static/git-scm.com/images/icons/branch-sm@2x.png +0 -0
  662. data/spec/support/static/git-scm.com/images/icons/camera-sm.png +0 -0
  663. data/spec/support/static/git-scm.com/images/icons/camera-sm@2x.png +0 -0
  664. data/spec/support/static/git-scm.com/images/icons/chevron-up@2x.png +0 -0
  665. data/spec/support/static/git-scm.com/images/icons/code.png +0 -0
  666. data/spec/support/static/git-scm.com/images/icons/code@2x.png +0 -0
  667. data/spec/support/static/git-scm.com/images/icons/debugging-sm.png +0 -0
  668. data/spec/support/static/git-scm.com/images/icons/debugging-sm@2x.png +0 -0
  669. data/spec/support/static/git-scm.com/images/icons/document.png +0 -0
  670. data/spec/support/static/git-scm.com/images/icons/document@2x.png +0 -0
  671. data/spec/support/static/git-scm.com/images/icons/download.png +0 -0
  672. data/spec/support/static/git-scm.com/images/icons/email-sm.png +0 -0
  673. data/spec/support/static/git-scm.com/images/icons/email-sm@2x.png +0 -0
  674. data/spec/support/static/git-scm.com/images/icons/external-sm.png +0 -0
  675. data/spec/support/static/git-scm.com/images/icons/external-sm@2x.png +0 -0
  676. data/spec/support/static/git-scm.com/images/icons/gui.png +0 -0
  677. data/spec/support/static/git-scm.com/images/icons/gui@2x.png +0 -0
  678. data/spec/support/static/git-scm.com/images/icons/info.png +0 -0
  679. data/spec/support/static/git-scm.com/images/icons/info@2x.png +0 -0
  680. data/spec/support/static/git-scm.com/images/icons/inspection-sm.png +0 -0
  681. data/spec/support/static/git-scm.com/images/icons/inspection-sm@2x.png +0 -0
  682. data/spec/support/static/git-scm.com/images/icons/linux.png +0 -0
  683. data/spec/support/static/git-scm.com/images/icons/linux@2x.png +0 -0
  684. data/spec/support/static/git-scm.com/images/icons/nav-circles.png +0 -0
  685. data/spec/support/static/git-scm.com/images/icons/nav-circles@2x.png +0 -0
  686. data/spec/support/static/git-scm.com/images/icons/patching-sm.png +0 -0
  687. data/spec/support/static/git-scm.com/images/icons/patching-sm@2x.png +0 -0
  688. data/spec/support/static/git-scm.com/images/icons/plumbing-sm.png +0 -0
  689. data/spec/support/static/git-scm.com/images/icons/plumbing-sm@2x.png +0 -0
  690. data/spec/support/static/git-scm.com/images/icons/projects-sm.png +0 -0
  691. data/spec/support/static/git-scm.com/images/icons/projects-sm@2x.png +0 -0
  692. data/spec/support/static/git-scm.com/images/icons/search.png +0 -0
  693. data/spec/support/static/git-scm.com/images/icons/search@2x.png +0 -0
  694. data/spec/support/static/git-scm.com/images/icons/server-admin-sm.png +0 -0
  695. data/spec/support/static/git-scm.com/images/icons/server-admin-sm@2x.png +0 -0
  696. data/spec/support/static/git-scm.com/images/icons/setup-sm.png +0 -0
  697. data/spec/support/static/git-scm.com/images/icons/setup-sm@2x.png +0 -0
  698. data/spec/support/static/git-scm.com/images/icons/sharing-sm.png +0 -0
  699. data/spec/support/static/git-scm.com/images/icons/sharing-sm@2x.png +0 -0
  700. data/spec/support/static/git-scm.com/images/icons/sidebar.png +0 -0
  701. data/spec/support/static/git-scm.com/images/icons/sidebar@2x.png +0 -0
  702. data/spec/support/static/git-scm.com/images/icons/source-code.png +0 -0
  703. data/spec/support/static/git-scm.com/images/icons/source-code@2x.png +0 -0
  704. data/spec/support/static/git-scm.com/images/icons/windows.png +0 -0
  705. data/spec/support/static/git-scm.com/images/icons/windows@2x.png +0 -0
  706. data/spec/support/static/git-scm.com/images/logo@2x.png +0 -0
  707. data/spec/support/static/git-scm.com/images/mobi.png +0 -0
  708. data/spec/support/static/git-scm.com/images/monitor-default.png +0 -0
  709. data/spec/support/static/git-scm.com/images/monitor-default@2x.png +0 -0
  710. data/spec/support/static/git-scm.com/images/monitor-linux.png +0 -0
  711. data/spec/support/static/git-scm.com/images/monitor-linux@2x.png +0 -0
  712. data/spec/support/static/git-scm.com/images/monitor-mac.png +0 -0
  713. data/spec/support/static/git-scm.com/images/monitor-mac@2x.png +0 -0
  714. data/spec/support/static/git-scm.com/images/monitor-windows.png +0 -0
  715. data/spec/support/static/git-scm.com/images/monitor-windows@2x.png +0 -0
  716. data/spec/support/static/git-scm.com/images/pdf.png +0 -0
  717. data/spec/support/static/git-scm.com/images/progit2.png +0 -0
  718. data/spec/support/static/git-scm.com/images/sidebar-divider.png +0 -0
  719. data/spec/support/static/git-scm.com/images/sidebar-divider@2x.png +0 -0
  720. data/spec/support/static/git-scm.com/robots.txt +0 -0
  721. data/spec/task_spec.rb +7 -0
  722. data/spec/wayfarer_spec.rb +1 -1
  723. data/wayfarer.gemspec +9 -8
  724. metadata +692 -47
  725. data/docs/guides/browser_automation/capybara.md +0 -3
  726. data/lib/wayfarer/config.rb +0 -67
  727. data/lib/wayfarer/middleware/worker.rb +0 -47
  728. data/lib/wayfarer/networking/healer.rb +0 -21
  729. data/lib/wayfarer/networking/net_http.rb +0 -52
  730. data/lib/wayfarer/routing/custom_matcher.rb +0 -21
  731. data/lib/wayfarer/routing/host_matcher.rb +0 -23
  732. data/lib/wayfarer/routing/path_matcher.rb +0 -46
  733. data/lib/wayfarer/routing/query_matcher.rb +0 -67
  734. data/lib/wayfarer/routing/scheme_matcher.rb +0 -21
  735. data/lib/wayfarer/routing/suffix_matcher.rb +0 -21
  736. data/lib/wayfarer/routing/url_matcher.rb +0 -21
  737. data/spec/config_spec.rb +0 -144
  738. data/spec/factories/queue/chain.rb +0 -11
  739. data/spec/middleware/worker_spec.rb +0 -90
  740. data/spec/networking/adapter.rb +0 -135
  741. data/spec/networking/healer_spec.rb +0 -46
  742. data/spec/networking/net_http_spec.rb +0 -37
@@ -0,0 +1,1741 @@
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 - Migrating to Git</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="ch00/_git_p4.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="ch00/ch01-getting-started.html">Getting Started</a></h2>
185
+ <ol>
186
+ <li>
187
+ 1.1
188
+ <a href="ch00/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="ch00/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="ch00/_editor.html" >First-Time Git Setup </a>
209
+ </li>
210
+ <li>
211
+ 1.7
212
+ <a href="ch00/_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="ch00/_git_cloning.html">Git Basics</a></h2>
222
+ <ol>
223
+ <li>
224
+ 2.1
225
+ <a href="ch00/_git_cloning.html" >Getting a Git Repository </a>
226
+ </li>
227
+ <li>
228
+ 2.2
229
+ <a href="ch00/_git_mv.html" >Recording Changes to the Repository </a>
230
+ </li>
231
+ <li>
232
+ 2.3
233
+ <a href="ch00/_viewing_history.html" >Viewing the Commit History </a>
234
+ </li>
235
+ <li>
236
+ 2.4
237
+ <a href="ch00/_unstaging.html" >Undoing Things </a>
238
+ </li>
239
+ <li>
240
+ 2.5
241
+ <a href="ch00/_remote_repos.html" >Working with Remotes </a>
242
+ </li>
243
+ <li>
244
+ 2.6
245
+ <a href="ch00/_annotated_tags.html" >Tagging </a>
246
+ </li>
247
+ <li>
248
+ 2.7
249
+ <a href="ch00/_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="ch00/_switching_branches.html">Git Branching</a></h2>
259
+ <ol>
260
+ <li>
261
+ 3.1
262
+ <a href="ch00/_switching_branches.html" >Branches in a Nutshell </a>
263
+ </li>
264
+ <li>
265
+ 3.2
266
+ <a href="ch00/_basic_branching.html" >Basic Branching and Merging </a>
267
+ </li>
268
+ <li>
269
+ 3.3
270
+ <a href="ch00/_branch_management.html" >Branch Management </a>
271
+ </li>
272
+ <li>
273
+ 3.4
274
+ <a href="ch00/_topic_branch.html" >Branching Workflows </a>
275
+ </li>
276
+ <li>
277
+ 3.5
278
+ <a href="ch00/_delete_branches.html" >Remote Branches </a>
279
+ </li>
280
+ <li>
281
+ 3.6
282
+ <a href="ch00/_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="ch00/_bare_repo.html" >Getting Git on a Server </a>
300
+ </li>
301
+ <li>
302
+ 4.3
303
+ <a href="ch00/_generate_ssh_key.html" >Generating Your SSH Public Key </a>
304
+ </li>
305
+ <li>
306
+ 4.4
307
+ <a href="ch00/_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="ch00/_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="ch00/_integration_manager.html">Distributed Git</a></h2>
337
+ <ol>
338
+ <li>
339
+ 5.1
340
+ <a href="ch00/_integration_manager.html" >Distributed Workflows </a>
341
+ </li>
342
+ <li>
343
+ 5.2
344
+ <a href="ch00/_project_over_email.html" >Contributing to a Project </a>
345
+ </li>
346
+ <li>
347
+ 5.3
348
+ <a href="ch00/_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="ch00/_personal_avatar.html">GitHub</a></h2>
363
+ <ol>
364
+ <li>
365
+ 6.1
366
+ <a href="ch00/_personal_avatar.html" >Account Setup and Configuration </a>
367
+ </li>
368
+ <li>
369
+ 6.2
370
+ <a href="ch00/_fetch_and_push_on_different_repositories.html" >Contributing to a Project </a>
371
+ </li>
372
+ <li>
373
+ 6.3
374
+ <a href="ch00/_email_notifications.html" >Maintaining a Project </a>
375
+ </li>
376
+ <li>
377
+ 6.4
378
+ <a href="ch00/_team_page.html" >Managing an organization </a>
379
+ </li>
380
+ <li>
381
+ 6.5
382
+ <a href="ch00/_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="ch00/_git_reflog.html">Git Tools</a></h2>
392
+ <ol>
393
+ <li>
394
+ 7.1
395
+ <a href="ch00/_git_reflog.html" >Revision Selection </a>
396
+ </li>
397
+ <li>
398
+ 7.2
399
+ <a href="ch00/_interactive_staging.html" >Interactive Staging </a>
400
+ </li>
401
+ <li>
402
+ 7.3
403
+ <a href="ch00/_git_clean.html" >Stashing and Cleaning </a>
404
+ </li>
405
+ <li>
406
+ 7.4
407
+ <a href="ch00/_signing_commits.html" >Signing Your Work </a>
408
+ </li>
409
+ <li>
410
+ 7.5
411
+ <a href="ch00/_git_grep.html" >Searching </a>
412
+ </li>
413
+ <li>
414
+ 7.6
415
+ <a href="ch00/_removing_file_every_commit.html" >Rewriting History </a>
416
+ </li>
417
+ <li>
418
+ 7.7
419
+ <a href="ch00/_the_index.html" >Reset Demystified </a>
420
+ </li>
421
+ <li>
422
+ 7.8
423
+ <a href="ch00/_reverse_commit.html" >Advanced Merging </a>
424
+ </li>
425
+ <li>
426
+ 7.9
427
+ <a href="ch00/ref_rerere.html" >Rerere </a>
428
+ </li>
429
+ <li>
430
+ 7.10
431
+ <a href="ch00/_file_annotation.html" >Debugging with Git </a>
432
+ </li>
433
+ <li>
434
+ 7.11
435
+ <a href="ch00/_publishing_submodules.html" >Submodules </a>
436
+ </li>
437
+ <li>
438
+ 7.12
439
+ <a href="ch00/_bundling.html" >Bundling </a>
440
+ </li>
441
+ <li>
442
+ 7.13
443
+ <a href="ch00/_replace.html" >Replace </a>
444
+ </li>
445
+ <li>
446
+ 7.14
447
+ <a href="ch00/_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="ch00/_external_merge_tools.html">Customizing Git</a></h2>
457
+ <ol>
458
+ <li>
459
+ 8.1
460
+ <a href="ch00/_external_merge_tools.html" >Git Configuration </a>
461
+ </li>
462
+ <li>
463
+ 8.2
464
+ <a href="ch00/_keyword_expansion.html" >Git Attributes </a>
465
+ </li>
466
+ <li>
467
+ 8.3
468
+ <a href="ch00/_email_hooks.html" >Git Hooks </a>
469
+ </li>
470
+ <li>
471
+ 8.4
472
+ <a href="ch00/_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="ch00/_git_svn.html">Git and Other Systems</a></h2>
482
+ <ol>
483
+ <li>
484
+ 9.1
485
+ <a href="ch00/_git_svn.html" >Git as a Client </a>
486
+ </li>
487
+ <li>
488
+ 9.2
489
+ <a href="ch00/_git_p4.html" class=active>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="ch00/_plumbing_porcelain.html">Git Internals</a></h2>
499
+ <ol>
500
+ <li>
501
+ 10.1
502
+ <a href="ch00/_plumbing_porcelain.html" >Plumbing and Porcelain </a>
503
+ </li>
504
+ <li>
505
+ 10.2
506
+ <a href="ch00/_git_commit_objects.html" >Git Objects </a>
507
+ </li>
508
+ <li>
509
+ 10.3
510
+ <a href="ch00/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="ch00/_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="ch00/_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="ch00/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="ch00/_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="ch00/ch_core_editor.html">Appendix C: Git Commands</a></h2>
611
+ <ol>
612
+ <li>
613
+ A3.1
614
+ <a href="ch00/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>9.2 Git and Other Systems - Migrating to Git</h1>
675
+ <div>
676
+ <h2 id="_migrating">Migrating to Git</h2>
677
+ <div class="paragraph">
678
+ <p>
679
+ If you have an existing codebase in another VCS but you’ve decided to start using Git, you must migrate your project one way or another.
680
+ This section goes over some importers for common systems, and then demonstrates how to develop your own custom importer.
681
+ You’ll learn how to import data from several of the bigger professionally used SCM systems, because they make up the majority of users who are switching, and because high-quality tools for them are easy to come by.</p>
682
+ </div>
683
+ <div class="sect3">
684
+ <h3 id="_subversion">Subversion</h3>
685
+ <div class="paragraph">
686
+ <p>
687
+
688
+ If you read the previous section about using <code>git svn</code>, you can easily use those instructions to <code>git svn clone</code> a repository; then, stop using the Subversion server, push to a new Git server, and start using that.
689
+ If you want the history, you can accomplish that as quickly as you can pull the data out of the Subversion server (which may take a while).</p>
690
+ </div>
691
+ <div class="paragraph">
692
+ <p>However, the import isn’t perfect; and because it will take so long, you may as well do it right.
693
+ The first problem is the author information.
694
+ In Subversion, each person committing has a user on the system who is recorded in the commit information.
695
+ The examples in the previous section show <code>schacon</code> in some places, such as the <code>blame</code> output and the <code>git svn log</code>.
696
+ If you want to map this to better Git author data, you need a mapping from the Subversion users to the Git authors.
697
+ Create a file called <code>users.txt</code> that has this mapping in a format like this:</p>
698
+ </div>
699
+ <div class="listingblock">
700
+ <div class="content">
701
+ <pre class="highlight"><code>schacon = Scott Chacon &lt;schacon@geemail.com&gt;
702
+ selse = Someo Nelse &lt;selse@geemail.com&gt;</code></pre>
703
+ </div>
704
+ </div>
705
+ <div class="paragraph">
706
+ <p>To get a list of the author names that SVN uses, you can run this:</p>
707
+ </div>
708
+ <div class="listingblock">
709
+ <div class="content">
710
+ <pre class="highlight"><code class="language-console" data-lang="console">$ svn log --xml --quiet | grep author | sort -u | \
711
+ perl -pe 's/.*&gt;(.*?)&lt;.*/$1 = /'</code></pre>
712
+ </div>
713
+ </div>
714
+ <div class="paragraph">
715
+ <p>That generates the log output in XML format, then keeps only the lines with author information, discards duplicates, strips out the XML tags.
716
+ Obviously this only works on a machine with <code>grep</code>, <code>sort</code>, and <code>perl</code> installed.
717
+ Then, redirect that output into your <code>users.txt</code> file so you can add the equivalent Git user data next to each entry.</p>
718
+ </div>
719
+ <div class="admonitionblock note">
720
+ <table>
721
+ <tr>
722
+ <td class="icon">
723
+ <div class="title">Note</div>
724
+ </td>
725
+ <td class="content">
726
+ <div class="paragraph">
727
+ <p>If you’re trying this on a Windows machine, this is the point where you’ll run into trouble.
728
+ Microsoft have provided some good advice and samples at <a href="https://docs.microsoft.com/en-us/azure/devops/repos/git/perform-migration-from-svn-to-git" class="bare">https://docs.microsoft.com/en-us/azure/devops/repos/git/perform-migration-from-svn-to-git</a>.</p>
729
+ </div>
730
+ </td>
731
+ </tr>
732
+ </table>
733
+ </div>
734
+ <div class="paragraph">
735
+ <p>You can provide this file to <code>git svn</code> to help it map the author data more accurately.
736
+ You can also tell <code>git svn</code> not to include the metadata that Subversion normally imports, by passing <code>--no-metadata</code> to the <code>clone</code> or <code>init</code> command.
737
+ The metadata includes a <code>git-svn-id</code> inside each commit message that Git will generate during import.
738
+ This can bloat your Git log and might make it a bit unclear.</p>
739
+ </div>
740
+ <div class="admonitionblock note">
741
+ <table>
742
+ <tr>
743
+ <td class="icon">
744
+ <div class="title">Note</div>
745
+ </td>
746
+ <td class="content">
747
+ <div class="paragraph">
748
+ <p>You need to keep the metadata when you want to mirror commits made in the Git repository back into the original SVN repository.
749
+ If you don’t want the synchronization in your commit log, feel free to omit the <code>--no-metadata</code> parameter.</p>
750
+ </div>
751
+ </td>
752
+ </tr>
753
+ </table>
754
+ </div>
755
+ <div class="paragraph">
756
+ <p>This makes your <code>import</code> command look like this:</p>
757
+ </div>
758
+ <div class="listingblock">
759
+ <div class="content">
760
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git svn clone http://my-project.googlecode.com/svn/ \
761
+ --authors-file=users.txt --no-metadata --prefix "" -s my_project
762
+ $ cd my_project</code></pre>
763
+ </div>
764
+ </div>
765
+ <div class="paragraph">
766
+ <p>Now you should have a nicer Subversion import in your <code>my_project</code> directory.
767
+ Instead of commits that look like this:</p>
768
+ </div>
769
+ <div class="listingblock">
770
+ <div class="content">
771
+ <pre class="highlight"><code>commit 37efa680e8473b615de980fa935944215428a35a
772
+ Author: schacon &lt;schacon@4c93b258-373f-11de-be05-5f7a86268029&gt;
773
+ Date: Sun May 3 00:12:22 2009 +0000
774
+
775
+ fixed install - go to trunk
776
+
777
+ git-svn-id: https://my-project.googlecode.com/svn/trunk@94 4c93b258-373f-11de-
778
+ be05-5f7a86268029</code></pre>
779
+ </div>
780
+ </div>
781
+ <div class="paragraph">
782
+ <p>they look like this:</p>
783
+ </div>
784
+ <div class="listingblock">
785
+ <div class="content">
786
+ <pre class="highlight"><code>commit 03a8785f44c8ea5cdb0e8834b7c8e6c469be2ff2
787
+ Author: Scott Chacon &lt;schacon@geemail.com&gt;
788
+ Date: Sun May 3 00:12:22 2009 +0000
789
+
790
+ fixed install - go to trunk</code></pre>
791
+ </div>
792
+ </div>
793
+ <div class="paragraph">
794
+ <p>Not only does the Author field look a lot better, but the <code>git-svn-id</code> is no longer there, either.</p>
795
+ </div>
796
+ <div class="paragraph">
797
+ <p>You should also do a bit of post-import cleanup.
798
+ For one thing, you should clean up the weird references that <code>git svn</code> set up.
799
+ First you’ll move the tags so they’re actual tags rather than strange remote branches, and then you’ll move the rest of the branches so they’re local.</p>
800
+ </div>
801
+ <div class="paragraph">
802
+ <p>To move the tags to be proper Git tags, run:</p>
803
+ </div>
804
+ <div class="listingblock">
805
+ <div class="content">
806
+ <pre class="highlight"><code class="language-console" data-lang="console">$ for t in $(git for-each-ref --format='%(refname:short)' refs/remotes/tags); do git tag ${t/tags\//} $t &amp;&amp; git branch -D -r $t; done</code></pre>
807
+ </div>
808
+ </div>
809
+ <div class="paragraph">
810
+ <p>This takes the references that were remote branches that started with <code>refs/remotes/tags/</code> and makes them real (lightweight) tags.</p>
811
+ </div>
812
+ <div class="paragraph">
813
+ <p>Next, move the rest of the references under <code>refs/remotes</code> to be local branches:</p>
814
+ </div>
815
+ <div class="listingblock">
816
+ <div class="content">
817
+ <pre class="highlight"><code class="language-console" data-lang="console">$ for b in $(git for-each-ref --format='%(refname:short)' refs/remotes); do git branch $b refs/remotes/$b &amp;&amp; git branch -D -r $b; done</code></pre>
818
+ </div>
819
+ </div>
820
+ <div class="paragraph">
821
+ <p>It may happen that you’ll see some extra branches which are suffixed by <code>@xxx</code> (where xxx is a number), while in Subversion you only see one branch.
822
+ This is actually a Subversion feature called “peg-revisions”, which is something that Git simply has no syntactical counterpart for.
823
+ Hence, <code>git svn</code> simply adds the svn version number to the branch name just in the same way as you would have written it in svn to address the peg-revision of that branch.
824
+ If you do not care anymore about the peg-revisions, simply remove them:</p>
825
+ </div>
826
+ <div class="listingblock">
827
+ <div class="content">
828
+ <pre class="highlight"><code class="language-console" data-lang="console">$ for p in $(git for-each-ref --format='%(refname:short)' | grep @); do git branch -D $p; done</code></pre>
829
+ </div>
830
+ </div>
831
+ <div class="paragraph">
832
+ <p>Now all the old branches are real Git branches and all the old tags are real Git tags.</p>
833
+ </div>
834
+ <div class="paragraph">
835
+ <p>There’s one last thing to clean up.
836
+ Unfortunately, <code>git svn</code> creates an extra branch named <code>trunk</code>, which maps to Subversion’s default branch, but the <code>trunk</code> ref points to the same place as <code>master</code>.
837
+ Since <code>master</code> is more idiomatically Git, here’s how to remove the extra branch:</p>
838
+ </div>
839
+ <div class="listingblock">
840
+ <div class="content">
841
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git branch -d trunk</code></pre>
842
+ </div>
843
+ </div>
844
+ <div class="paragraph">
845
+ <p>The last thing to do is add your new Git server as a remote and push to it.
846
+ Here is an example of adding your server as a remote:</p>
847
+ </div>
848
+ <div class="listingblock">
849
+ <div class="content">
850
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git remote add origin git@my-git-server:myrepository.git</code></pre>
851
+ </div>
852
+ </div>
853
+ <div class="paragraph">
854
+ <p>Because you want all your branches and tags to go up, you can now run this:</p>
855
+ </div>
856
+ <div class="listingblock">
857
+ <div class="content">
858
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git push origin --all
859
+ $ git push origin --tags</code></pre>
860
+ </div>
861
+ </div>
862
+ <div class="paragraph">
863
+ <p>All your branches and tags should be on your new Git server in a nice, clean import.</p>
864
+ </div>
865
+ </div>
866
+ <div class="sect3">
867
+ <h3 id="_mercurial">Mercurial</h3>
868
+ <div class="paragraph">
869
+ <p>
870
+ Since Mercurial and Git have fairly similar models for representing versions, and since Git is a bit more flexible, converting a repository from Mercurial to Git is fairly straightforward, using a tool called "hg-fast-export", which you’ll need a copy of:</p>
871
+ </div>
872
+ <div class="listingblock">
873
+ <div class="content">
874
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git clone https://github.com/frej/fast-export.git</code></pre>
875
+ </div>
876
+ </div>
877
+ <div class="paragraph">
878
+ <p>The first step in the conversion is to get a full clone of the Mercurial repository you want to convert:</p>
879
+ </div>
880
+ <div class="listingblock">
881
+ <div class="content">
882
+ <pre class="highlight"><code class="language-console" data-lang="console">$ hg clone &lt;remote repo URL&gt; /tmp/hg-repo</code></pre>
883
+ </div>
884
+ </div>
885
+ <div class="paragraph">
886
+ <p>The next step is to create an author mapping file.
887
+ Mercurial is a bit more forgiving than Git for what it will put in the author field for changesets, so this is a good time to clean house.
888
+ Generating this is a one-line command in a <code>bash</code> shell:</p>
889
+ </div>
890
+ <div class="listingblock">
891
+ <div class="content">
892
+ <pre class="highlight"><code class="language-console" data-lang="console">$ cd /tmp/hg-repo
893
+ $ hg log | grep user: | sort | uniq | sed 's/user: *//' &gt; ../authors</code></pre>
894
+ </div>
895
+ </div>
896
+ <div class="paragraph">
897
+ <p>This will take a few seconds, depending on how long your project’s history is, and afterwards the <code>/tmp/authors</code> file will look something like this:</p>
898
+ </div>
899
+ <div class="listingblock">
900
+ <div class="content">
901
+ <pre class="highlight"><code>bob
902
+ bob@localhost
903
+ bob &lt;bob@company.com&gt;
904
+ bob jones &lt;bob &lt;AT&gt; company &lt;DOT&gt; com&gt;
905
+ Bob Jones &lt;bob@company.com&gt;
906
+ Joe Smith &lt;joe@company.com&gt;</code></pre>
907
+ </div>
908
+ </div>
909
+ <div class="paragraph">
910
+ <p>In this example, the same person (Bob) has created changesets under four different names, one of which actually looks correct, and one of which would be completely invalid for a Git commit.
911
+ Hg-fast-export lets us fix this by turning each line into a rule: <code>"&lt;input&gt;"="&lt;output&gt;"</code>, mapping an <code>&lt;input&gt;</code> to an <code>&lt;output&gt;</code>.
912
+ Inside the <code>&lt;input&gt;</code> and <code>&lt;output&gt;</code> strings, all escape sequences understood by the python <code>string_escape</code> encoding are supported.
913
+ If the author mapping file does not contain a matching <code>&lt;input&gt;</code>, that author will be sent on to Git unmodified.
914
+ If all the usernames look fine, we won’t need this file at all.
915
+ In this example, we want our file to look like this:</p>
916
+ </div>
917
+ <div class="listingblock">
918
+ <div class="content">
919
+ <pre class="highlight"><code>"bob"="Bob Jones &lt;bob@company.com&gt;"
920
+ "bob@localhost"="Bob Jones &lt;bob@company.com&gt;"
921
+ "bob &lt;bob@company.com&gt;"="Bob Jones &lt;bob@company.com&gt;"
922
+ "bob jones &lt;bob &lt;AT&gt; company &lt;DOT&gt; com&gt;"="Bob Jones &lt;bob@company.com&gt;"</code></pre>
923
+ </div>
924
+ </div>
925
+ <div class="paragraph">
926
+ <p>The same kind of mapping file can be used to rename branches and tags when the Mercurial name is not allowed by Git.</p>
927
+ </div>
928
+ <div class="paragraph">
929
+ <p>The next step is to create our new Git repository, and run the export script:</p>
930
+ </div>
931
+ <div class="listingblock">
932
+ <div class="content">
933
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git init /tmp/converted
934
+ $ cd /tmp/converted
935
+ $ /tmp/fast-export/hg-fast-export.sh -r /tmp/hg-repo -A /tmp/authors</code></pre>
936
+ </div>
937
+ </div>
938
+ <div class="paragraph">
939
+ <p>The <code>-r</code> flag tells hg-fast-export where to find the Mercurial repository we want to convert, and the <code>-A</code> flag tells it where to find the author-mapping file (branch and tag mapping files are specified by the <code>-B</code> and <code>-T</code> flags respectively).
940
+ The script parses Mercurial changesets and converts them into a script for Git’s "fast-import" feature (which we’ll discuss in detail a bit later on).
941
+ This takes a bit (though it’s <em>much</em> faster than it would be over the network), and the output is fairly verbose:</p>
942
+ </div>
943
+ <div class="listingblock">
944
+ <div class="content">
945
+ <pre class="highlight"><code class="language-console" data-lang="console">$ /tmp/fast-export/hg-fast-export.sh -r /tmp/hg-repo -A /tmp/authors
946
+ Loaded 4 authors
947
+ master: Exporting full revision 1/22208 with 13/0/0 added/changed/removed files
948
+ master: Exporting simple delta revision 2/22208 with 1/1/0 added/changed/removed files
949
+ master: Exporting simple delta revision 3/22208 with 0/1/0 added/changed/removed files
950
+ […]
951
+ master: Exporting simple delta revision 22206/22208 with 0/4/0 added/changed/removed files
952
+ master: Exporting simple delta revision 22207/22208 with 0/2/0 added/changed/removed files
953
+ master: Exporting thorough delta revision 22208/22208 with 3/213/0 added/changed/removed files
954
+ Exporting tag [0.4c] at [hg r9] [git :10]
955
+ Exporting tag [0.4d] at [hg r16] [git :17]
956
+ […]
957
+ Exporting tag [3.1-rc] at [hg r21926] [git :21927]
958
+ Exporting tag [3.1] at [hg r21973] [git :21974]
959
+ Issued 22315 commands
960
+ git-fast-import statistics:
961
+ ---------------------------------------------------------------------
962
+ Alloc'd objects: 120000
963
+ Total objects: 115032 ( 208171 duplicates )
964
+ blobs : 40504 ( 205320 duplicates 26117 deltas of 39602 attempts)
965
+ trees : 52320 ( 2851 duplicates 47467 deltas of 47599 attempts)
966
+ commits: 22208 ( 0 duplicates 0 deltas of 0 attempts)
967
+ tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
968
+ Total branches: 109 ( 2 loads )
969
+ marks: 1048576 ( 22208 unique )
970
+ atoms: 1952
971
+ Memory total: 7860 KiB
972
+ pools: 2235 KiB
973
+ objects: 5625 KiB
974
+ ---------------------------------------------------------------------
975
+ pack_report: getpagesize() = 4096
976
+ pack_report: core.packedGitWindowSize = 1073741824
977
+ pack_report: core.packedGitLimit = 8589934592
978
+ pack_report: pack_used_ctr = 90430
979
+ pack_report: pack_mmap_calls = 46771
980
+ pack_report: pack_open_windows = 1 / 1
981
+ pack_report: pack_mapped = 340852700 / 340852700
982
+ ---------------------------------------------------------------------
983
+
984
+ $ git shortlog -sn
985
+ 369 Bob Jones
986
+ 365 Joe Smith</code></pre>
987
+ </div>
988
+ </div>
989
+ <div class="paragraph">
990
+ <p>That’s pretty much all there is to it.
991
+ All of the Mercurial tags have been converted to Git tags, and Mercurial branches and bookmarks have been converted to Git branches.
992
+ Now you’re ready to push the repository up to its new server-side home:</p>
993
+ </div>
994
+ <div class="listingblock">
995
+ <div class="content">
996
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git remote add origin git@my-git-server:myrepository.git
997
+ $ git push origin --all</code></pre>
998
+ </div>
999
+ </div>
1000
+ </div>
1001
+ <div class="sect3">
1002
+ <h3 id="_bazaar">Bazaar</h3>
1003
+ <div class="paragraph">
1004
+ <p></p>
1005
+ </div>
1006
+ <div class="paragraph">
1007
+ <p>Bazaar is a DVCS tool much like Git, and as a result it’s pretty straightforward to convert a Bazaar repository into a Git one.
1008
+ To accomplish this, you’ll need to import the <code>bzr-fastimport</code> plugin.</p>
1009
+ </div>
1010
+ <div class="sect4">
1011
+ <h4 id="_getting_the_bzr_fastimport_plugin">Getting the bzr-fastimport plugin</h4>
1012
+ <div class="paragraph">
1013
+ <p>The procedure for installing the fastimport plugin is different on UNIX-like operating systems and on Windows.
1014
+ In the first case, the simplest is to install the <code>bzr-fastimport</code> package that will install all the required dependencies.</p>
1015
+ </div>
1016
+ <div class="paragraph">
1017
+ <p>For example, with Debian and derived, you would do the following:</p>
1018
+ </div>
1019
+ <div class="listingblock">
1020
+ <div class="content">
1021
+ <pre class="highlight"><code class="language-console" data-lang="console">$ sudo apt-get install bzr-fastimport</code></pre>
1022
+ </div>
1023
+ </div>
1024
+ <div class="paragraph">
1025
+ <p>With RHEL, you would do the following:</p>
1026
+ </div>
1027
+ <div class="listingblock">
1028
+ <div class="content">
1029
+ <pre class="highlight"><code class="language-console" data-lang="console">$ sudo yum install bzr-fastimport</code></pre>
1030
+ </div>
1031
+ </div>
1032
+ <div class="paragraph">
1033
+ <p>With Fedora, since release 22, the new package manager is dnf:</p>
1034
+ </div>
1035
+ <div class="listingblock">
1036
+ <div class="content">
1037
+ <pre class="highlight"><code class="language-console" data-lang="console">$ sudo dnf install bzr-fastimport</code></pre>
1038
+ </div>
1039
+ </div>
1040
+ <div class="paragraph">
1041
+ <p>If the package is not available, you may install it as a plugin:</p>
1042
+ </div>
1043
+ <div class="listingblock">
1044
+ <div class="content">
1045
+ <pre class="highlight"><code class="language-console" data-lang="console">$ mkdir --parents ~/.bazaar/plugins # creates the necessary folders for the plugins
1046
+ $ cd ~/.bazaar/plugins
1047
+ $ bzr branch lp:bzr-fastimport fastimport # imports the fastimport plugin
1048
+ $ cd fastimport
1049
+ $ sudo python setup.py install --record=files.txt # installs the plugin</code></pre>
1050
+ </div>
1051
+ </div>
1052
+ <div class="paragraph">
1053
+ <p>For this plugin to work, you’ll also need the <code>fastimport</code> Python module.
1054
+ You can check whether it is present or not and install it with the following commands:</p>
1055
+ </div>
1056
+ <div class="listingblock">
1057
+ <div class="content">
1058
+ <pre class="highlight"><code class="language-console" data-lang="console">$ python -c "import fastimport"
1059
+ Traceback (most recent call last):
1060
+ File "&lt;string&gt;", line 1, in &lt;module&gt;
1061
+ ImportError: No module named fastimport
1062
+ $ pip install fastimport</code></pre>
1063
+ </div>
1064
+ </div>
1065
+ <div class="paragraph">
1066
+ <p>If it is not available, you can download it at address <a href="https://pypi.python.org/pypi/fastimport/" class="bare">https://pypi.python.org/pypi/fastimport/</a>.</p>
1067
+ </div>
1068
+ <div class="paragraph">
1069
+ <p>In the second case (on Windows), <code>bzr-fastimport</code> is automatically installed with the standalone version and the default installation (let all the checkboxes checked).
1070
+ So in this case you have nothing to do.</p>
1071
+ </div>
1072
+ <div class="paragraph">
1073
+ <p>At this point, the way to import a Bazaar repository differs according to that you have a single branch or you are working with a repository that has several branches.</p>
1074
+ </div>
1075
+ </div>
1076
+ <div class="sect4">
1077
+ <h4 id="_project_with_a_single_branch">Project with a single branch</h4>
1078
+ <div class="paragraph">
1079
+ <p>Now <code>cd</code> in the directory that contains your Bazaar repository and initialize the Git repository:</p>
1080
+ </div>
1081
+ <div class="listingblock">
1082
+ <div class="content">
1083
+ <pre class="highlight"><code class="language-console" data-lang="console">$ cd /path/to/the/bzr/repository
1084
+ $ git init</code></pre>
1085
+ </div>
1086
+ </div>
1087
+ <div class="paragraph">
1088
+ <p>Now, you can simply export your Bazaar repository and convert it into a Git repository using the following command:</p>
1089
+ </div>
1090
+ <div class="listingblock">
1091
+ <div class="content">
1092
+ <pre class="highlight"><code class="language-console" data-lang="console">$ bzr fast-export --plain . | git fast-import</code></pre>
1093
+ </div>
1094
+ </div>
1095
+ <div class="paragraph">
1096
+ <p>Depending on the size of the project, your Git repository is built in a lapse from a few seconds to a few minutes.</p>
1097
+ </div>
1098
+ </div>
1099
+ <div class="sect4">
1100
+ <h4 id="_case_of_a_project_with_a_main_branch_and_a_working_branch">Case of a project with a main branch and a working branch</h4>
1101
+ <div class="paragraph">
1102
+ <p>You can also import a Bazaar repository that contains branches.
1103
+ Let us suppose that you have two branches: one represents the main branch (myProject.trunk), the other one is the working branch (myProject.work).</p>
1104
+ </div>
1105
+ <div class="listingblock">
1106
+ <div class="content">
1107
+ <pre class="highlight"><code class="language-console" data-lang="console">$ ls
1108
+ myProject.trunk myProject.work</code></pre>
1109
+ </div>
1110
+ </div>
1111
+ <div class="paragraph">
1112
+ <p>Create the Git repository and <code>cd</code> into it:</p>
1113
+ </div>
1114
+ <div class="listingblock">
1115
+ <div class="content">
1116
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git init git-repo
1117
+ $ cd git-repo</code></pre>
1118
+ </div>
1119
+ </div>
1120
+ <div class="paragraph">
1121
+ <p>Pull the <code>master</code> branch into git:</p>
1122
+ </div>
1123
+ <div class="listingblock">
1124
+ <div class="content">
1125
+ <pre class="highlight"><code class="language-console" data-lang="console">$ bzr fast-export --export-marks=../marks.bzr ../myProject.trunk | \
1126
+ git fast-import --export-marks=../marks.git</code></pre>
1127
+ </div>
1128
+ </div>
1129
+ <div class="paragraph">
1130
+ <p>Pull the working branch into Git:</p>
1131
+ </div>
1132
+ <div class="listingblock">
1133
+ <div class="content">
1134
+ <pre class="highlight"><code class="language-console" data-lang="console">$ bzr fast-export --marks=../marks.bzr --git-branch=work ../myProject.work | \
1135
+ git fast-import --import-marks=../marks.git --export-marks=../marks.git</code></pre>
1136
+ </div>
1137
+ </div>
1138
+ <div class="paragraph">
1139
+ <p>Now <code>git branch</code> shows you the <code>master</code> branch as well as the <code>work</code> branch.
1140
+ Check the logs to make sure they’re complete and get rid of the <code>marks.bzr</code> and <code>marks.git</code> files.</p>
1141
+ </div>
1142
+ </div>
1143
+ <div class="sect4">
1144
+ <h4 id="_synchronizing_the_staging_area">Synchronizing the staging area</h4>
1145
+ <div class="paragraph">
1146
+ <p>Whatever the number of branches you had and the import method you used, your staging area is not synchronized with <code>HEAD</code>, and with the import of several branches, your working directory is not synchronized either.
1147
+ This situation is easily solved by the following command:</p>
1148
+ </div>
1149
+ <div class="listingblock">
1150
+ <div class="content">
1151
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git reset --hard HEAD</code></pre>
1152
+ </div>
1153
+ </div>
1154
+ </div>
1155
+ <div class="sect4">
1156
+ <h4 id="_ignoring_the_files_that_were_ignored_with_bzrignore">Ignoring the files that were ignored with .bzrignore</h4>
1157
+ <div class="paragraph">
1158
+ <p>Now let’s have a look at the files to ignore.
1159
+ The first thing to do is to rename <code>.bzrignore</code> into <code>.gitignore</code>.
1160
+ If the <code>.bzrignore</code> file contains one or several lines starting with "!!" or "RE:", you’ll have to modify it and perhaps create several <code>.gitignore</code> files in order to ignore exactly the same files that Bazaar was ignoring.</p>
1161
+ </div>
1162
+ <div class="paragraph">
1163
+ <p>Finally, you will have to create a commit that contains this modification for the migration:</p>
1164
+ </div>
1165
+ <div class="listingblock">
1166
+ <div class="content">
1167
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git mv .bzrignore .gitignore
1168
+ $ # modify .gitignore if needed
1169
+ $ git commit -am 'Migration from Bazaar to Git'</code></pre>
1170
+ </div>
1171
+ </div>
1172
+ </div>
1173
+ <div class="sect4">
1174
+ <h4 id="_sending_your_repository_to_the_server">Sending your repository to the server</h4>
1175
+ <div class="paragraph">
1176
+ <p>Here we are!
1177
+ Now you can push the repository onto its new home server:</p>
1178
+ </div>
1179
+ <div class="listingblock">
1180
+ <div class="content">
1181
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git remote add origin git@my-git-server:mygitrepository.git
1182
+ $ git push origin --all
1183
+ $ git push origin --tags</code></pre>
1184
+ </div>
1185
+ </div>
1186
+ <div class="paragraph">
1187
+ <p>Your Git repository is ready to use.</p>
1188
+ </div>
1189
+ </div>
1190
+ </div>
1191
+ <div class="sect3">
1192
+ <h3 id="_perforce_import">Perforce</h3>
1193
+ <div class="paragraph">
1194
+ <p>
1195
+ The next system you’ll look at importing from is Perforce.
1196
+ As we discussed above, there are two ways to let Git and Perforce talk to each other: git-p4 and Perforce Git Fusion.</p>
1197
+ </div>
1198
+ <div class="sect4">
1199
+ <h4 id="_perforce_git_fusion">Perforce Git Fusion</h4>
1200
+ <div class="paragraph">
1201
+ <p>Git Fusion makes this process fairly painless.
1202
+ Just configure your project settings, user mappings, and branches using a configuration file (as discussed in <a href="ch00/_p4_git_fusion.html">Git Fusion</a>), and clone the repository.
1203
+ Git Fusion leaves you with what looks like a native Git repository, which is then ready to push to a native Git host if you desire.
1204
+ You could even use Perforce as your Git host if you like.</p>
1205
+ </div>
1206
+ </div>
1207
+ <div class="sect4">
1208
+ <h4 id="_git_p4">Git-p4</h4>
1209
+ <div class="paragraph">
1210
+ <p>Git-p4 can also act as an import tool.
1211
+ As an example, we’ll import the Jam project from the Perforce Public Depot.
1212
+ To set up your client, you must export the P4PORT environment variable to point to the Perforce depot:</p>
1213
+ </div>
1214
+ <div class="listingblock">
1215
+ <div class="content">
1216
+ <pre class="highlight"><code class="language-console" data-lang="console">$ export P4PORT=public.perforce.com:1666</code></pre>
1217
+ </div>
1218
+ </div>
1219
+ <div class="admonitionblock note">
1220
+ <table>
1221
+ <tr>
1222
+ <td class="icon">
1223
+ <div class="title">Note</div>
1224
+ </td>
1225
+ <td class="content">
1226
+ <div class="paragraph">
1227
+ <p>In order to follow along, you’ll need a Perforce depot to connect with.
1228
+ We’ll be using the public depot at public.perforce.com for our examples, but you can use any depot you have access to.</p>
1229
+ </div>
1230
+ </td>
1231
+ </tr>
1232
+ </table>
1233
+ </div>
1234
+ <div class="paragraph">
1235
+ <p>
1236
+ Run the <code>git p4 clone</code> command to import the Jam project from the Perforce server, supplying the depot and project path and the path into which you want to import the project:</p>
1237
+ </div>
1238
+ <div class="listingblock">
1239
+ <div class="content">
1240
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git-p4 clone //guest/perforce_software/jam@all p4import
1241
+ Importing from //guest/perforce_software/jam@all into p4import
1242
+ Initialized empty Git repository in /private/tmp/p4import/.git/
1243
+ Import destination: refs/remotes/p4/master
1244
+ Importing revision 9957 (100%)</code></pre>
1245
+ </div>
1246
+ </div>
1247
+ <div class="paragraph">
1248
+ <p>This particular project has only one branch, but if you have branches that are configured with branch views (or just a set of directories), you can use the <code>--detect-branches</code> flag to <code>git p4 clone</code> to import all the project’s branches as well.
1249
+ See <a href="ch00/_git_p4_branches.html">Branching</a> for a bit more detail on this.</p>
1250
+ </div>
1251
+ <div class="paragraph">
1252
+ <p>At this point you’re almost done.
1253
+ If you go to the <code>p4import</code> directory and run <code>git log</code>, you can see your imported work:</p>
1254
+ </div>
1255
+ <div class="listingblock">
1256
+ <div class="content">
1257
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git log -2
1258
+ commit e5da1c909e5db3036475419f6379f2c73710c4e6
1259
+ Author: giles &lt;giles@giles@perforce.com&gt;
1260
+ Date: Wed Feb 8 03:13:27 2012 -0800
1261
+
1262
+ Correction to line 355; change &lt;/UL&gt; to &lt;/OL&gt;.
1263
+
1264
+ [git-p4: depot-paths = "//public/jam/src/": change = 8068]
1265
+
1266
+ commit aa21359a0a135dda85c50a7f7cf249e4f7b8fd98
1267
+ Author: kwirth &lt;kwirth@perforce.com&gt;
1268
+ Date: Tue Jul 7 01:35:51 2009 -0800
1269
+
1270
+ Fix spelling error on Jam doc page (cummulative -&gt; cumulative).
1271
+
1272
+ [git-p4: depot-paths = "//public/jam/src/": change = 7304]</code></pre>
1273
+ </div>
1274
+ </div>
1275
+ <div class="paragraph">
1276
+ <p>You can see that <code>git-p4</code> has left an identifier in each commit message.
1277
+ It’s fine to keep that identifier there, in case you need to reference the Perforce change number later.
1278
+ However, if you’d like to remove the identifier, now is the time to do so – before you start doing work on the new repository.
1279
+
1280
+ You can use <code>git filter-branch</code> to remove the identifier strings en masse:</p>
1281
+ </div>
1282
+ <div class="listingblock">
1283
+ <div class="content">
1284
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git filter-branch --msg-filter 'sed -e "/^\[git-p4:/d"'
1285
+ Rewrite e5da1c909e5db3036475419f6379f2c73710c4e6 (125/125)
1286
+ Ref 'refs/heads/master' was rewritten</code></pre>
1287
+ </div>
1288
+ </div>
1289
+ <div class="paragraph">
1290
+ <p>If you run <code>git log</code>, you can see that all the SHA-1 checksums for the commits have changed, but the <code>git-p4</code> strings are no longer in the commit messages:</p>
1291
+ </div>
1292
+ <div class="listingblock">
1293
+ <div class="content">
1294
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git log -2
1295
+ commit b17341801ed838d97f7800a54a6f9b95750839b7
1296
+ Author: giles &lt;giles@giles@perforce.com&gt;
1297
+ Date: Wed Feb 8 03:13:27 2012 -0800
1298
+
1299
+ Correction to line 355; change &lt;/UL&gt; to &lt;/OL&gt;.
1300
+
1301
+ commit 3e68c2e26cd89cb983eb52c024ecdfba1d6b3fff
1302
+ Author: kwirth &lt;kwirth@perforce.com&gt;
1303
+ Date: Tue Jul 7 01:35:51 2009 -0800
1304
+
1305
+ Fix spelling error on Jam doc page (cummulative -&gt; cumulative).</code></pre>
1306
+ </div>
1307
+ </div>
1308
+ <div class="paragraph">
1309
+ <p>Your import is ready to push up to your new Git server.</p>
1310
+ </div>
1311
+ </div>
1312
+ </div>
1313
+ <div class="sect3">
1314
+ <h3 id="_custom_importer">A Custom Importer</h3>
1315
+ <div class="paragraph">
1316
+ <p>
1317
+
1318
+ If your system isn’t one of the above, you should look for an importer online – quality importers are available for many other systems, including CVS, Clear Case, Visual Source Safe, even a directory of archives.
1319
+ If none of these tools works for you, you have a more obscure tool, or you otherwise need a more custom importing process, you should use <code>git fast-import</code>.
1320
+ This command reads simple instructions from stdin to write specific Git data.
1321
+ It’s much easier to create Git objects this way than to run the raw Git commands or try to write the raw objects (see <a href="ch00/ch10-git-internals.html">Git Internals</a> for more information).
1322
+ This way, you can write an import script that reads the necessary information out of the system you’re importing from and prints straightforward instructions to stdout.
1323
+ You can then run this program and pipe its output through <code>git fast-import</code>.</p>
1324
+ </div>
1325
+ <div class="paragraph">
1326
+ <p>To quickly demonstrate, you’ll write a simple importer.
1327
+ Suppose you work in <code>current</code>, you back up your project by occasionally copying the directory into a time-stamped <code>back_YYYY_MM_DD</code> backup directory, and you want to import this into Git.
1328
+ Your directory structure looks like this:</p>
1329
+ </div>
1330
+ <div class="listingblock">
1331
+ <div class="content">
1332
+ <pre class="highlight"><code class="language-console" data-lang="console">$ ls /opt/import_from
1333
+ back_2014_01_02
1334
+ back_2014_01_04
1335
+ back_2014_01_14
1336
+ back_2014_02_03
1337
+ current</code></pre>
1338
+ </div>
1339
+ </div>
1340
+ <div class="paragraph">
1341
+ <p>In order to import a Git directory, you need to review how Git stores its data.
1342
+ As you may remember, Git is fundamentally a linked list of commit objects that point to a snapshot of content.
1343
+ All you have to do is tell <code>fast-import</code> what the content snapshots are, what commit data points to them, and the order they go in.
1344
+ Your strategy will be to go through the snapshots one at a time and create commits with the contents of each directory, linking each commit back to the previous one.</p>
1345
+ </div>
1346
+ <div class="paragraph">
1347
+ <p>As we did in <a href="ch00/_an_example_git_enforced_policy.html">An Example Git-Enforced Policy</a>, we’ll write this in Ruby, because it’s what we generally work with and it tends to be easy to read.
1348
+ You can write this example pretty easily in anything you’re familiar with – it just needs to print the appropriate information to <code>stdout</code>.
1349
+ And, if you are running on Windows, this means you’ll need to take special care to not introduce carriage returns at the end your lines – <code>git fast-import</code> is very particular about just wanting line feeds (LF) not the carriage return line feeds (CRLF) that Windows uses.</p>
1350
+ </div>
1351
+ <div class="paragraph">
1352
+ <p>To begin, you’ll change into the target directory and identify every subdirectory, each of which is a snapshot that you want to import as a commit.
1353
+ You’ll change into each subdirectory and print the commands necessary to export it.
1354
+ Your basic main loop looks like this:</p>
1355
+ </div>
1356
+ <div class="listingblock">
1357
+ <div class="content">
1358
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">last_mark = nil
1359
+
1360
+ # loop through the directories
1361
+ Dir.chdir(ARGV[0]) do
1362
+ Dir.glob("*").each do |dir|
1363
+ next if File.file?(dir)
1364
+
1365
+ # move into the target directory
1366
+ Dir.chdir(dir) do
1367
+ last_mark = print_export(dir, last_mark)
1368
+ end
1369
+ end
1370
+ end</code></pre>
1371
+ </div>
1372
+ </div>
1373
+ <div class="paragraph">
1374
+ <p>You run <code>print_export</code> inside each directory, which takes the manifest and mark of the previous snapshot and returns the manifest and mark of this one; that way, you can link them properly.
1375
+ “Mark” is the <code>fast-import</code> term for an identifier you give to a commit; as you create commits, you give each one a mark that you can use to link to it from other commits.
1376
+ So, the first thing to do in your <code>print_export</code> method is generate a mark from the directory name:</p>
1377
+ </div>
1378
+ <div class="listingblock">
1379
+ <div class="content">
1380
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">mark = convert_dir_to_mark(dir)</code></pre>
1381
+ </div>
1382
+ </div>
1383
+ <div class="paragraph">
1384
+ <p>You’ll do this by creating an array of directories and using the index value as the mark, because a mark must be an integer.
1385
+ Your method looks like this:</p>
1386
+ </div>
1387
+ <div class="listingblock">
1388
+ <div class="content">
1389
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">$marks = []
1390
+ def convert_dir_to_mark(dir)
1391
+ if !$marks.include?(dir)
1392
+ $marks &lt;&lt; dir
1393
+ end
1394
+ ($marks.index(dir) + 1).to_s
1395
+ end</code></pre>
1396
+ </div>
1397
+ </div>
1398
+ <div class="paragraph">
1399
+ <p>Now that you have an integer representation of your commit, you need a date for the commit metadata.
1400
+ Because the date is expressed in the name of the directory, you’ll parse it out.
1401
+ The next line in your <code>print_export</code> file is:</p>
1402
+ </div>
1403
+ <div class="listingblock">
1404
+ <div class="content">
1405
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">date = convert_dir_to_date(dir)</code></pre>
1406
+ </div>
1407
+ </div>
1408
+ <div class="paragraph">
1409
+ <p>where <code>convert_dir_to_date</code> is defined as:</p>
1410
+ </div>
1411
+ <div class="listingblock">
1412
+ <div class="content">
1413
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">def convert_dir_to_date(dir)
1414
+ if dir == 'current'
1415
+ return Time.now().to_i
1416
+ else
1417
+ dir = dir.gsub('back_', '')
1418
+ (year, month, day) = dir.split('_')
1419
+ return Time.local(year, month, day).to_i
1420
+ end
1421
+ end</code></pre>
1422
+ </div>
1423
+ </div>
1424
+ <div class="paragraph">
1425
+ <p>That returns an integer value for the date of each directory.
1426
+ The last piece of meta-information you need for each commit is the committer data, which you hardcode in a global variable:</p>
1427
+ </div>
1428
+ <div class="listingblock">
1429
+ <div class="content">
1430
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">$author = 'John Doe &lt;john@example.com&gt;'</code></pre>
1431
+ </div>
1432
+ </div>
1433
+ <div class="paragraph">
1434
+ <p>Now you’re ready to begin printing out the commit data for your importer.
1435
+ The initial information states that you’re defining a commit object and what branch it’s on, followed by the mark you’ve generated, the committer information and commit message, and then the previous commit, if any.
1436
+ The code looks like this:</p>
1437
+ </div>
1438
+ <div class="listingblock">
1439
+ <div class="content">
1440
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby"># print the import information
1441
+ puts 'commit refs/heads/master'
1442
+ puts 'mark :' + mark
1443
+ puts "committer #{$author} #{date} -0700"
1444
+ export_data('imported from ' + dir)
1445
+ puts 'from :' + last_mark if last_mark</code></pre>
1446
+ </div>
1447
+ </div>
1448
+ <div class="paragraph">
1449
+ <p>You hardcode the time zone (-0700) because doing so is easy.
1450
+ If you’re importing from another system, you must specify the time zone as an offset.
1451
+ The commit message must be expressed in a special format:</p>
1452
+ </div>
1453
+ <div class="listingblock">
1454
+ <div class="content">
1455
+ <pre class="highlight"><code>data (size)\n(contents)</code></pre>
1456
+ </div>
1457
+ </div>
1458
+ <div class="paragraph">
1459
+ <p>The format consists of the word data, the size of the data to be read, a newline, and finally the data.
1460
+ Because you need to use the same format to specify the file contents later, you create a helper method, <code>export_data</code>:</p>
1461
+ </div>
1462
+ <div class="listingblock">
1463
+ <div class="content">
1464
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">def export_data(string)
1465
+ print "data #{string.size}\n#{string}"
1466
+ end</code></pre>
1467
+ </div>
1468
+ </div>
1469
+ <div class="paragraph">
1470
+ <p>All that’s left is to specify the file contents for each snapshot.
1471
+ This is easy, because you have each one in a directory – you can print out the <code>deleteall</code> command followed by the contents of each file in the directory.
1472
+ Git will then record each snapshot appropriately:</p>
1473
+ </div>
1474
+ <div class="listingblock">
1475
+ <div class="content">
1476
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">puts 'deleteall'
1477
+ Dir.glob("**/*").each do |file|
1478
+ next if !File.file?(file)
1479
+ inline_data(file)
1480
+ end</code></pre>
1481
+ </div>
1482
+ </div>
1483
+ <div class="paragraph">
1484
+ <p>Note: Because many systems think of their revisions as changes from one commit to another, fast-import can also take commands with each commit to specify which files have been added, removed, or modified and what the new contents are.
1485
+ You could calculate the differences between snapshots and provide only this data, but doing so is more complex – you may as well give Git all the data and let it figure it out.
1486
+ If this is better suited to your data, check the <code>fast-import</code> man page for details about how to provide your data in this manner.</p>
1487
+ </div>
1488
+ <div class="paragraph">
1489
+ <p>The format for listing the new file contents or specifying a modified file with the new contents is as follows:</p>
1490
+ </div>
1491
+ <div class="listingblock">
1492
+ <div class="content">
1493
+ <pre class="highlight"><code>M 644 inline path/to/file
1494
+ data (size)
1495
+ (file contents)</code></pre>
1496
+ </div>
1497
+ </div>
1498
+ <div class="paragraph">
1499
+ <p>Here, 644 is the mode (if you have executable files, you need to detect and specify 755 instead), and inline says you’ll list the contents immediately after this line.
1500
+ Your <code>inline_data</code> method looks like this:</p>
1501
+ </div>
1502
+ <div class="listingblock">
1503
+ <div class="content">
1504
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">def inline_data(file, code = 'M', mode = '644')
1505
+ content = File.read(file)
1506
+ puts "#{code} #{mode} inline #{file}"
1507
+ export_data(content)
1508
+ end</code></pre>
1509
+ </div>
1510
+ </div>
1511
+ <div class="paragraph">
1512
+ <p>You reuse the <code>export_data</code> method you defined earlier, because it’s the same as the way you specified your commit message data.</p>
1513
+ </div>
1514
+ <div class="paragraph">
1515
+ <p>The last thing you need to do is to return the current mark so it can be passed to the next iteration:</p>
1516
+ </div>
1517
+ <div class="listingblock">
1518
+ <div class="content">
1519
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">return mark</code></pre>
1520
+ </div>
1521
+ </div>
1522
+ <div class="admonitionblock note">
1523
+ <table>
1524
+ <tr>
1525
+ <td class="icon">
1526
+ <div class="title">Note</div>
1527
+ </td>
1528
+ <td class="content">
1529
+ <div class="paragraph">
1530
+ <p>If you are running on Windows you’ll need to make sure that you add one extra step.
1531
+ As mentioned before, Windows uses CRLF for new line characters while <code>git fast-import</code> expects only LF.
1532
+ To get around this problem and make <code>git fast-import</code> happy, you need to tell ruby to use LF instead of CRLF:</p>
1533
+ </div>
1534
+ <div class="listingblock">
1535
+ <div class="content">
1536
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">$stdout.binmode</code></pre>
1537
+ </div>
1538
+ </div>
1539
+ </td>
1540
+ </tr>
1541
+ </table>
1542
+ </div>
1543
+ <div class="paragraph">
1544
+ <p>That’s it.
1545
+ Here’s the script in its entirety:</p>
1546
+ </div>
1547
+ <div class="listingblock">
1548
+ <div class="content">
1549
+ <pre class="highlight"><code class="language-ruby" data-lang="ruby">#!/usr/bin/env ruby
1550
+
1551
+ $stdout.binmode
1552
+ $author = "John Doe &lt;john@example.com&gt;"
1553
+
1554
+ $marks = []
1555
+ def convert_dir_to_mark(dir)
1556
+ if !$marks.include?(dir)
1557
+ $marks &lt;&lt; dir
1558
+ end
1559
+ ($marks.index(dir)+1).to_s
1560
+ end
1561
+
1562
+ def convert_dir_to_date(dir)
1563
+ if dir == 'current'
1564
+ return Time.now().to_i
1565
+ else
1566
+ dir = dir.gsub('back_', '')
1567
+ (year, month, day) = dir.split('_')
1568
+ return Time.local(year, month, day).to_i
1569
+ end
1570
+ end
1571
+
1572
+ def export_data(string)
1573
+ print "data #{string.size}\n#{string}"
1574
+ end
1575
+
1576
+ def inline_data(file, code='M', mode='644')
1577
+ content = File.read(file)
1578
+ puts "#{code} #{mode} inline #{file}"
1579
+ export_data(content)
1580
+ end
1581
+
1582
+ def print_export(dir, last_mark)
1583
+ date = convert_dir_to_date(dir)
1584
+ mark = convert_dir_to_mark(dir)
1585
+
1586
+ puts 'commit refs/heads/master'
1587
+ puts "mark :#{mark}"
1588
+ puts "committer #{$author} #{date} -0700"
1589
+ export_data("imported from #{dir}")
1590
+ puts "from :#{last_mark}" if last_mark
1591
+
1592
+ puts 'deleteall'
1593
+ Dir.glob("**/*").each do |file|
1594
+ next if !File.file?(file)
1595
+ inline_data(file)
1596
+ end
1597
+ mark
1598
+ end
1599
+
1600
+ # Loop through the directories
1601
+ last_mark = nil
1602
+ Dir.chdir(ARGV[0]) do
1603
+ Dir.glob("*").each do |dir|
1604
+ next if File.file?(dir)
1605
+
1606
+ # move into the target directory
1607
+ Dir.chdir(dir) do
1608
+ last_mark = print_export(dir, last_mark)
1609
+ end
1610
+ end
1611
+ end</code></pre>
1612
+ </div>
1613
+ </div>
1614
+ <div class="paragraph">
1615
+ <p>If you run this script, you’ll get content that looks something like this:</p>
1616
+ </div>
1617
+ <div class="listingblock">
1618
+ <div class="content">
1619
+ <pre class="highlight"><code class="language-console" data-lang="console">$ ruby import.rb /opt/import_from
1620
+ commit refs/heads/master
1621
+ mark :1
1622
+ committer John Doe &lt;john@example.com&gt; 1388649600 -0700
1623
+ data 29
1624
+ imported from back_2014_01_02deleteall
1625
+ M 644 inline README.md
1626
+ data 28
1627
+ # Hello
1628
+
1629
+ This is my readme.
1630
+ commit refs/heads/master
1631
+ mark :2
1632
+ committer John Doe &lt;john@example.com&gt; 1388822400 -0700
1633
+ data 29
1634
+ imported from back_2014_01_04from :1
1635
+ deleteall
1636
+ M 644 inline main.rb
1637
+ data 34
1638
+ #!/bin/env ruby
1639
+
1640
+ puts "Hey there"
1641
+ M 644 inline README.md
1642
+ (...)</code></pre>
1643
+ </div>
1644
+ </div>
1645
+ <div class="paragraph">
1646
+ <p>To run the importer, pipe this output through <code>git fast-import</code> while in the Git directory you want to import into.
1647
+ You can create a new directory and then run <code>git init</code> in it for a starting point, and then run your script:</p>
1648
+ </div>
1649
+ <div class="listingblock">
1650
+ <div class="content">
1651
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git init
1652
+ Initialized empty Git repository in /opt/import_to/.git/
1653
+ $ ruby import.rb /opt/import_from | git fast-import
1654
+ git-fast-import statistics:
1655
+ ---------------------------------------------------------------------
1656
+ Alloc'd objects: 5000
1657
+ Total objects: 13 ( 6 duplicates )
1658
+ blobs : 5 ( 4 duplicates 3 deltas of 5 attempts)
1659
+ trees : 4 ( 1 duplicates 0 deltas of 4 attempts)
1660
+ commits: 4 ( 1 duplicates 0 deltas of 0 attempts)
1661
+ tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
1662
+ Total branches: 1 ( 1 loads )
1663
+ marks: 1024 ( 5 unique )
1664
+ atoms: 2
1665
+ Memory total: 2344 KiB
1666
+ pools: 2110 KiB
1667
+ objects: 234 KiB
1668
+ ---------------------------------------------------------------------
1669
+ pack_report: getpagesize() = 4096
1670
+ pack_report: core.packedGitWindowSize = 1073741824
1671
+ pack_report: core.packedGitLimit = 8589934592
1672
+ pack_report: pack_used_ctr = 10
1673
+ pack_report: pack_mmap_calls = 5
1674
+ pack_report: pack_open_windows = 2 / 2
1675
+ pack_report: pack_mapped = 1457 / 1457
1676
+ ---------------------------------------------------------------------</code></pre>
1677
+ </div>
1678
+ </div>
1679
+ <div class="paragraph">
1680
+ <p>As you can see, when it completes successfully, it gives you a bunch of statistics about what it accomplished.
1681
+ In this case, you imported 13 objects total for 4 commits into 1 branch.
1682
+ Now, you can run <code>git log</code> to see your new history:</p>
1683
+ </div>
1684
+ <div class="listingblock">
1685
+ <div class="content">
1686
+ <pre class="highlight"><code class="language-console" data-lang="console">$ git log -2
1687
+ commit 3caa046d4aac682a55867132ccdfbe0d3fdee498
1688
+ Author: John Doe &lt;john@example.com&gt;
1689
+ Date: Tue Jul 29 19:39:04 2014 -0700
1690
+
1691
+ imported from current
1692
+
1693
+ commit 4afc2b945d0d3c8cd00556fbe2e8224569dc9def
1694
+ Author: John Doe &lt;john@example.com&gt;
1695
+ Date: Mon Feb 3 01:00:00 2014 -0700
1696
+
1697
+ imported from back_2014_02_03</code></pre>
1698
+ </div>
1699
+ </div>
1700
+ <div class="paragraph">
1701
+ <p>There you go – a nice, clean Git repository.
1702
+ It’s important to note that nothing is checked out – you don’t have any files in your working directory at first.
1703
+ To get them, you must reset your branch to where <code>master</code> is now:</p>
1704
+ </div>
1705
+ <div class="listingblock">
1706
+ <div class="content">
1707
+ <pre class="highlight"><code class="language-console" data-lang="console">$ ls
1708
+ $ git reset --hard master
1709
+ HEAD is now at 3caa046 imported from current
1710
+ $ ls
1711
+ README.md main.rb</code></pre>
1712
+ </div>
1713
+ </div>
1714
+ <div class="paragraph">
1715
+ <p>You can do a lot more with the <code>fast-import</code> tool – handle different modes, binary data, multiple branches and merging, tags, progress indicators, and more.
1716
+ A number of examples of more complex scenarios are available in the <code>contrib/fast-import</code> directory of the Git source code.</p>
1717
+ </div>
1718
+ </div>
1719
+ <div id="nav"><a href="ch00/_git_svn.html">prev</a> | <a href="Git-and-Other-Systems-Summary.html">next</a></div></div>
1720
+ </div>
1721
+
1722
+ </div>
1723
+ </div>
1724
+ <footer>
1725
+ <div class="site-source">
1726
+ <a href="https://git-scm.com/site">About this site</a><br>
1727
+ Patches, suggestions, and comments are welcome.
1728
+ </div>
1729
+ <div class="sfc-member">
1730
+ Git is a member of <a href="https://git-scm.com/sfc">Software Freedom Conservancy</a>
1731
+ </div>
1732
+ </footer>
1733
+ <a href="ch00/_git_p4.html#top" class="no-js scrollToTop" id="scrollToTop" data-label="Scroll to top">
1734
+ <img src="../../../images/icons/chevron-up@2x.png" width="20" height="20" alt="scroll-to-top"/>
1735
+ </a>
1736
+ <script src="../../../assets/application-38b0d42ff05ffea45841edebbd14b75b89585646153808e82907c2c5c11f324b.js"></script>
1737
+
1738
+ </div>
1739
+
1740
+ </body>
1741
+ </html>