I had some troubles with Git. So, I deleted manually all files in my local repository in order to clone all the files from my Github repository (I replaced every files of my local repository with the files from the online Github repository). The cloned files are located in the same place as before. Then I used the command:
git pull
and the terminal answers:
error: Pull is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
Then I do:
git status
On branch master
Your branch and 'origin/master' have diverged,
and have 2 and 5 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
You have unmerged paths.
(fix conflicts and run "git commit")
Changes to be committed:
new file: src/main.cpp
new file: src/render.dia
new file: src/render/Scene.h
new file: src/state.dia.autosave
new file: src/state.h
new file: src/state/Status.h
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: rapport/rapport.odt
I do not understand why I have an unmerged file since I have just cloned the repository from GitHub to my local repository. In addition, I did not modify the files:
src/main.cpp
src/render.dia
src/render/Scene.h
src/state.dia.autosave
src/state.h
src/state/Status.h
Then I tried:
git reset --hard HEAD~1
HEAD is now at 9a68811 Revert "f"
and:
git pull
warning: Cannot merge binary files: src/render.dia (HEAD vs. e89ed43391b963508ea8aecfb7012ae7dda71cb0)
warning: Cannot merge binary files: rapport/rapport.odt (HEAD vs. e89ed43391b963508ea8aecfb7012ae7dda71cb0)
Auto-merging src/render/Scene.h
CONFLICT (add/add): Merge conflict in src/render/Scene.h
Auto-merging src/render.dia
CONFLICT (add/add): Merge conflict in src/render.dia
Auto-merging src/main.cpp
CONFLICT (add/add): Merge conflict in src/main.cpp
Auto-merging rapport/rapport.odt
CONFLICT (content): Merge conflict in rapport/rapport.odt
Automatic merge failed; fix conflicts and then commit the result.
How can I make my local version of master
match the remote version of master
?