Git cannot pull due to unrelated files

I just tried replacing the master branch on my server with another branch, as master was broken and I could not solve the error problem ...

The branch I replaced is the latest working version I had. I did this by running the following commands from my local machine:

git checkout lastWorkingBranch

git merge -s ours master

git check wizard

git merge lastWorkingBranch master

git press start of original

Then on the server I ran

git main source of traction

However, this gave the following result:

 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'. root@moon :/code/moon# git stash costing/views.py: needs merge tools.py: needs merge costing/views.py: needs merge tools.py: needs merge costing/views.py: unmerged (395725168ffab1962655116880b74158de3e1e56) costing/views.py: unmerged (95ff89d4160135c2ebefd67a0fc1af2f2a0abc74) costing/views.py: unmerged (902f9ff57c808cefd074f3ea07fb252f9eedb4e2) tools.py: unmerged (6832dd3197f838a52396381c30ef55069e24411b) tools.py: unmerged (24e8179f7689ffacdd50407259f3a12b3d3f609a) tools.py: unmerged (93b3d0baa5f1b75c85120cc2e7cab7dcd949b9a5) fatal: git-write-tree: error building trees Cannot save the current index state 

I tried to commit and click again on my local computer and then run pull again on the server and now get the following message:

U costing / views.py U tools.py It’s impossible to pull out, because you have files without garbage. Please correct them in the work tree, and then use 'git add / rm' as necessary to mark permission or use 'git commit -a'. root @moon: / code / moon #

I do not understand why I get this ...? I combined and clicked all my files - how can I fix them in the work tree?

+5
source share
1 answer

You have several unrelated files. So first create commit or stash files.

 $ git commit -am <message> # add and commit $ git pull origin master # pull origin Or, $ git add . $ git stash # remove the files $ git pull origin master 
+7
source

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


All Articles