Git pulled from the wrong branch

I have two branches on the server. Branched branch of R2 and a branch called DEV I inadvertently entered the wrong server, into the repository and executed GIT PULL ORIGIN DEV however the storage was on R2. I realized my mistake and then tried to fix my mistake by running GIT PULL ORIGIN R2 However, I get a bunch of file names and an error

U view/private_api/ipn.phtml M view/reports/menScholarshipForm.pdf M view/reports/printProCard.phtml M view/reports/printSanction.phtml M view/sanctionDetailRoster.html M view/sanctionDetailVerify.html M view/verifyMembership.phtml Pull is not possible because you have unmerged files. Please, fix them up in the work tree, and then use 'git add/rm <file>' as appropriate to mark resolution, or use 'git commit -a'. 

I don’t think I need to enter and reload each file manually, I just don’t know how to fix my error. thanks

+4
source share
1 answer

git pull is just a shorthand for git fetch followed by git merge FETCH_HEAD . It looks like you encountered some conflicts at the git merge stage.

git merge --abort will abort the merge process and try to restore the pre-merge state.

In reset R2 , which is in origin/R2 :

 git checkout R2 git fetch origin git stash # because it always a good thing to do git reset --hard origin/R2 
+6
source

Source: https://habr.com/ru/post/1501928/


All Articles