Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # We are going to create conflict
- # So we need origin repo
- ~$ mkdir rebase-please
- ~$ cd rebase-please
- ~/rebase-please$ mkdir origin
- ~/rebase-please$ cd origin/
- ~/rebase-please/origin$ git init
- Initialized empty Git repository in /home/sergeykish/rebase-please/origin/.git/
- ~/rebase-please/origin$ git config receive.denyCurrentBranch ignore
- ~/rebase-please/origin$ cat >test
- class Some
- def say
- "I speak english"
- end
- end
- ~/rebase-please/origin$ git add .
- ~/rebase-please/origin$ git commit -m 'on english'
- [master (root-commit) d4bcc8d] on english
- 1 files changed, 5 insertions(+), 0 deletions(-)
- create mode 100644 test
- # And another one with different content
- ~/rebase-please/origin$ cd ..
- ~/rebase-please$ git clone origin/ local
- Cloning into local...
- done.
- ~/rebase-please$ cd local/
- ~/rebase-please/local$ git checkout -b german
- Switched to a new branch 'german'
- ~/rebase-please/local$ cat >test
- class Some
- def say
- 'Ich spreche Deutsch'
- end
- end
- ~/rebase-please/local$ git commit -am 'on german'
- [german 24a6dcc] on german
- 1 files changed, 1 insertions(+), 1 deletions(-)
- # And change origin content
- ~/rebase-please/local$ cd ../origin/
- ~/rebase-please/origin$ cat >test
- class Some
- def say
- "私は日本語が話せる"
- end
- end
- ~/rebase-please/origin$ git commit -am 'on japanese'
- [master 8642155] on japanese
- 1 files changed, 2 insertions(+), 2 deletions(-)
- # Now we have a conflict and we are going to solve it
- ~/rebase-please/origin$ cd ../local/
- ~/rebase-please/local$ git checkout master
- Switched to branch 'master'
- ~/rebase-please/local$ git pull
- remote: Counting objects: 5, done.
- remote: Compressing objects: 100% (2/2), done.
- remote: Total 3 (delta 0), reused 0 (delta 0)
- Unpacking objects: 100% (3/3), done.
- From /home/sergeykish/rebase-please/origin
- d4bcc8d..8642155 master -> origin/master
- Updating d4bcc8d..8642155
- Fast-forward
- test | 4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
- ~/rebase-please/local$ git checkout german
- Switched to branch 'german'
- ~/rebase-please/local$ git rebase master
- First, rewinding head to replay your work on top of it...
- Applying: on german
- Using index info to reconstruct a base tree...
- Falling back to patching base and 3-way merge...
- Auto-merging test
- CONFLICT (content): Merge conflict in test
- Failed to merge in the changes.
- Patch failed at 0001 on german
- When you have resolved this problem run "git rebase --continue".
- If you would prefer to skip this patch, instead run "git rebase --skip".
- To restore the original branch and stop rebasing run "git rebase --abort".
- ~/rebase-please/local$ cat test
- class Some
- <<<<<<< HEAD
- def say
- "私は日本語が話せる"
- =======
- def say
- 'Ich spreche Deutsch'
- >>>>>>> on german
- end
- end
- ~/rebase-please/local$ cat >test
- class Some
- def say
- 'Ich spreche 日本語'
- end
- end
- ~/rebase-please/local$ git add .
- ~/rebase-please/local$ git rebase --continue
- Applying: on german
- # Thats all! Push changes to origin and clean environment
- ~/rebase-please/local$ git push origin HEAD:master
- Counting objects: 5, done.
- Delta compression using up to 2 threads.
- Compressing objects: 100% (2/2), done.
- Writing objects: 100% (3/3), 297 bytes, done.
- Total 3 (delta 0), reused 0 (delta 0)
- Unpacking objects: 100% (3/3), done.
- To /home/sergeykish/rebase-please/origin/
- 8642155..96731a6 HEAD -> master
- ~/rebase-please/local$ git branch -d german
Add Comment
Please, Sign In to add comment