15.04 Rebase example
12 / 46
git init &&
echo -e "# README\n" > README.md &&
git add . &&
git commit -m "initial commit" &&
echo "This is a readme file." >> README.md
&&
git commit -a -m "updated readme" &&
git checkout HEAD~1 &&
git checkout -b feature &&
echo "feature branch. " >> README.md &&
git commit -a -m "feature update."
setup
git rebase master
First, rewinding head to replay your work on top of
it...
Applying: feature update.
Using index info to reconstruct a base tree...
M README.md
.git/rebase-apply/patch:8: trailing whitespace.
feature branch.
warning: 1 line adds whitespace errors.
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 feature update.
The copy of the patch that failed is found in:
.git/rebase-apply/patch
Resolve all conflicts manually, mark them as
resolved with
"git add/rm <conflicted_files>", then run "git
rebase --continue".
You can instead skip this commit: run "git rebase
--skip".
To abort and get back to the state before "git
rebase", run "git rebase --abort".