I have a repository rep1with two commits on a branch master. These commits have the file.txtfollowing contents:
line1
line2
I clone rep1in rep2and check out the remote branch as tracking:
git checkout --track rep1/master
Then in this repository I change the first line file.txtas follows:
line1-modified-rep2
line2
Make a commit. Then change your second line to
line1-modified-rep2
line2-modified-rep2
Make a commit. So, here in rep2, I added two commits to a branch masterthat tracks the remote branch rep1/master.
Now I am going to create a conflict. In the remote repository, rep1I create a third commit (there are already two), changing file.txton the first and second lines:
line1-modified-rep1
line2-modified-rep1
, . rep2 rep1, rebase .
, rebase rep2 ( -rep2) rep1 ( prefix -rep1), :
rep2, line1-modified-rep1 vs line1-modified-rep2rep2, line2-modified-rep1 vs line2-modified-rep2
, rep1. ?
PS. , .
EDIT:
, rebase :
A
\
B
:


, :
line1-modified-rep2
line2
git, phpstorm ( rep1):
23:19:49.586: git -c core.quotepath=false fetch origin --progress --prune
remote: Counting objects: 5, done.[K
remote: Total 3 (delta 0), reused 0 (delta 0)[K
From E:/rep1
acc72ac..e6317e8 master -> origin/master
23:20:39.118: cd E:\rep2
23:20:39.118: git -c core.quotepath=false rebase origin/master
First, rewinding head to replay your work on top of it...
Applying: rep2-commit 2
Using index info to reconstruct a base tree...
M file.txt
Falling back to patching base and 3-way merge...
Auto-merging file.txt
CONFLICT (content): Merge conflict in file.txt
Failed to merge in the changes.
Patch failed at 0001 rep2-commit 2
The copy of the patch that failed is found in:
e:/rep2/.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".
23:24:33.418: cd E:\rep2
23:24:33.418: git -c core.quotepath=false add --ignore-errors -- file.txt
23:24:33.630: cd E:\rep2
23:24:33.630: git -c core.quotepath=false rebase --continue
Applying: rep2-commit 2
Applying: rep2-commit 3