I have a local git repository and I run the following:
git.exe pull -v --no-rebase --progress "origin" // pull 1
(make a few local commits)
git.exe pull -v --no-rebase --progress "origin" // pull 2
git log --pretty=format:"%h - %an : %s" // log 1
git rebase -i HEAD~4
(move local commit 1 down 2 positions)
git log --pretty=format:"%h - %an : %s" // log 2
git.exe pull -v --no-rebase --progress "origin" // pull 3
git log --pretty=format:"%h - %an : %s" // log 3
After doing this all commits to the remote repository that I retrieved in pull 1 are now duplicated in the log.
Log 1 looks like this:
84e4015 - Me : Local Commit 3
0dbe86a - Me : Local Commit 2
d57ba2a - Me : Merge branch 'master' of remote repository
a86ea35 - Me : Local Commit 1 before reordering
2fc4fe7 - Remote User 2 : Remote Commit 2
b7a8656 - Remote User 1 : Remote Commit 1
8ce80fc - Me : Merge branch 'master' of remote repository
Log 2 looks like this:
cf1ff7b - Me : Local Commit 3
cd14463 - Me : Local Commit 2
b9d44fb - Me : Local Commit 1 after reordering
9777c56 - Remote User 2 : Remote Commit 2
a2d7d8b - Remote User 1 : Remote Commit 1
8ce80fc - Me : Merge branch 'master' of remote repository
And log 3 looks like this:
e8e1a85 - Me : Merge branch 'master' of remote repository
cf1ff7b - Me : Local Commit 3
cd14463 - Me : Local Commit 2
b9d44fb - Me : Local Commit 1 after reordering
9777c56 - Remote User 2 : Remote Commit 2
a2d7d8b - Remote User 1 : Remote Commit 1
2fc4fe7 - Remote User 2 : Remote Commit 2 // duplicate 2
b7a8656 - Remote User 1 : Remote Commit 1 // duplicate 1
8ce80fc - Me : Merge branch 'master' of remote repository
What have I done wrong? How do I prevent? How do I fix?
Note that I've never pushed to the remote repository, only pulled from it and made local commits. Also note that there are a lot of similarly titled threads to this question but all of them are a little different and the answers there don't seem to apply here.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…