I made a copy of a repo from github. Was just playing around the code a bit, made a branch committed that changes locally and now the original code is updated,so I want to delete whatever I did to my fork and get changes made by the upstream.
I get a conflict if I do
git fetch upstream
git merge upstream/master
#Automatic merge failed; fix conflicts and then commit the result.
and gives in two file names showing few changes which I never did.
So I did a git status which gives me a new filename(which I never made but was made by my upstream) and Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
for two files.
I want all the new changes and destroy mine. What could possibly be the solution and why does GIT wants me to add a file I never made?
Abort the conflicted merge:
then set your local repo to the same commit as upstream, discarding local changes:
As for your question:
It doesn’t. It’s telling you to resolve the conflicts in the files you changed, then
git add <file>on those files, to mark the edited versions as resolved and OK to commit.