Skip to content

Instantly share code, notes, and snippets.

@lukassup
Created April 18, 2017 09:07
Show Gist options
  • Select an option

  • Save lukassup/f8da4ca6b483cef602490b5603e34361 to your computer and use it in GitHub Desktop.

Select an option

Save lukassup/f8da4ca6b483cef602490b5603e34361 to your computer and use it in GitHub Desktop.

git rebase

% git clone https://github.com/dhoer/chef-nexus3
Cloning into 'chef-nexus3'...
remote: Counting objects: 701, done.
remote: Total 701 (delta 0), reused 0 (delta 0), pack-reused 700
Receiving objects: 100% (701/701), 98.10 KiB | 0 bytes/s, done.
Resolving deltas: 100% (347/347), done.
% cd chef-nexus3
(git)-[master] % git checkout -b custom v2.0.0
Switched to a new branch 'custom'
(git)-[custom] % > README.md
(git)-[custom] % git commit -am 'Wiped out README.md'
[custom 5029176] Wiped out README.md
 1 file changed, 242 deletions(-)
 rewrite README.md (100%)
(git)-[custom] % git rebase master
First, rewinding head to replay your work on top of it...
Applying: Wiped out README.md
Using index info to reconstruct a base tree...
M	README.md
Falling back to patching base and 3-way merge...
Auto-merging README.md
CONFLICT (content): Merge conflict in README.md
error: Failed to merge in the changes.
Patch failed at 0001 Wiped out README.md
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
(git)-[custom|rebase] % vim README.md
(git)-[custom|rebase] % git rebase --continue                                                                                                                                   :(
README.md: needs merge
You must edit all merge conflicts and then
mark them as resolved using git add
(git)-[custom|rebase] % git add README.md
(git)-[custom|rebase] % git rebase --continue
Applying: Wiped out README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment