Guest User

Untitled

a guest
Jun 24th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. # We are going to create conflict
  2. # So we need origin repo
  3. ~$ mkdir rebase-please
  4. ~$ cd rebase-please
  5. ~/rebase-please$ mkdir origin
  6. ~/rebase-please$ cd origin/
  7. ~/rebase-please/origin$ git init
  8. Initialized empty Git repository in /home/sergeykish/rebase-please/origin/.git/
  9. ~/rebase-please/origin$ git config receive.denyCurrentBranch ignore
  10. ~/rebase-please/origin$ cat >test
  11. class Some
  12. def say
  13. "I speak english"
  14. end
  15. end
  16. ~/rebase-please/origin$ git add .
  17. ~/rebase-please/origin$ git commit -m 'on english'
  18. [master (root-commit) d4bcc8d] on english
  19. 1 files changed, 5 insertions(+), 0 deletions(-)
  20. create mode 100644 test
  21.  
  22. # And another one with different content
  23. ~/rebase-please/origin$ cd ..
  24. ~/rebase-please$ git clone origin/ local
  25. Cloning into local...
  26. done.
  27. ~/rebase-please$ cd local/
  28. ~/rebase-please/local$ git checkout -b german
  29. Switched to a new branch 'german'
  30. ~/rebase-please/local$ cat >test
  31. class Some
  32. def say
  33. 'Ich spreche Deutsch'
  34. end
  35. end
  36. ~/rebase-please/local$ git commit -am 'on german'
  37. [german 24a6dcc] on german
  38. 1 files changed, 1 insertions(+), 1 deletions(-)
  39.  
  40. # And change origin content
  41. ~/rebase-please/local$ cd ../origin/
  42. ~/rebase-please/origin$ cat >test
  43. class Some
  44. def say
  45. "私は日本語が話せる"
  46. end
  47. end
  48. ~/rebase-please/origin$ git commit -am 'on japanese'
  49. [master 8642155] on japanese
  50. 1 files changed, 2 insertions(+), 2 deletions(-)
  51.  
  52. # Now we have a conflict and we are going to solve it
  53. ~/rebase-please/origin$ cd ../local/
  54. ~/rebase-please/local$ git checkout master
  55. Switched to branch 'master'
  56. ~/rebase-please/local$ git pull
  57. remote: Counting objects: 5, done.
  58. remote: Compressing objects: 100% (2/2), done.
  59. remote: Total 3 (delta 0), reused 0 (delta 0)
  60. Unpacking objects: 100% (3/3), done.
  61. From /home/sergeykish/rebase-please/origin
  62. d4bcc8d..8642155 master -> origin/master
  63. Updating d4bcc8d..8642155
  64. Fast-forward
  65. test | 4 ++--
  66. 1 files changed, 2 insertions(+), 2 deletions(-)
  67. ~/rebase-please/local$ git checkout german
  68. Switched to branch 'german'
  69. ~/rebase-please/local$ git rebase master
  70. First, rewinding head to replay your work on top of it...
  71. Applying: on german
  72. Using index info to reconstruct a base tree...
  73. Falling back to patching base and 3-way merge...
  74. Auto-merging test
  75. CONFLICT (content): Merge conflict in test
  76. Failed to merge in the changes.
  77. Patch failed at 0001 on german
  78.  
  79. When you have resolved this problem run "git rebase --continue".
  80. If you would prefer to skip this patch, instead run "git rebase --skip".
  81. To restore the original branch and stop rebasing run "git rebase --abort".
  82.  
  83. ~/rebase-please/local$ cat test
  84. class Some
  85. <<<<<<< HEAD
  86. def say
  87. "私は日本語が話せる"
  88. =======
  89. def say
  90. 'Ich spreche Deutsch'
  91. >>>>>>> on german
  92. end
  93. end
  94. ~/rebase-please/local$ cat >test
  95. class Some
  96. def say
  97. 'Ich spreche 日本語'
  98. end
  99. end
  100. ~/rebase-please/local$ git add .
  101. ~/rebase-please/local$ git rebase --continue
  102. Applying: on german
  103.  
  104. # Thats all! Push changes to origin and clean environment
  105. ~/rebase-please/local$ git push origin HEAD:master
  106. Counting objects: 5, done.
  107. Delta compression using up to 2 threads.
  108. Compressing objects: 100% (2/2), done.
  109. Writing objects: 100% (3/3), 297 bytes, done.
  110. Total 3 (delta 0), reused 0 (delta 0)
  111. Unpacking objects: 100% (3/3), done.
  112. To /home/sergeykish/rebase-please/origin/
  113. 8642155..96731a6 HEAD -> master
  114. ~/rebase-please/local$ git branch -d german
Add Comment
Please, Sign In to add comment