Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git pull error: The following untracked working tree files would be overwritten by merge #92

Closed
PeterMatula opened this issue Jan 15, 2018 · 17 comments

Comments

@PeterMatula
Copy link
Collaborator

Pulling a new master ends with the following error:

$ git pull
error: The following untracked working tree files would be overwritten by merge:
        deps/googletest/CMakeLists.txt
        deps/libdwarf/CMakeLists.txt
        deps/llvm/CMakeLists.txt
Please move or remove them before you can merge.
Aborting
@PeterMatula
Copy link
Collaborator Author

PeterMatula commented Jan 15, 2018

This is caused by changing the basic structure of the retdec repository. We got rid of all git submodules. See https://github.com/avast-tl/retdec/wiki/Project-Repository-Structure for more details.

The are two possible solutions (pick only one):

  1. Remove the old repository and clone a new one (simple & foolproof):
rm -rf retdec
git clone https://github.com/avast-tl/retdec.git
  1. Or, fix the existing repository:
git submodule deinit --all
git pull
rm -rf build
rm -rf $RETDEC_INSTALL_DIR

@PeterMatula
Copy link
Collaborator Author

This is not really an issue that could be solved. Everyone that had retdec cloned before the change will have to manually fix the repository according to the instructions above.

I will keep this open for now, since this way, it is more visible for anyone searching for the reason why git pull is not working.

@MisterAwesome23
Copy link

This is caused by changing the basic structure of the retdec repository. We got rid of all git submodules. See https://github.com/avast-tl/retdec/wiki/Project-Repository-Structure for more details.

The are two possible solutions (pick only one):

  1. Remove the old repository and clone a new one (simple & foolproof):
rm -rf retdec
git clone https://github.com/avast-tl/retdec.git
  1. Or, fix the existing repository:
git submodule deinit --all
git pull
rm -rf build
rm -rf $RETDEC_INSTALL_DIR

Thanks :)

@mtkumar82
Copy link

git fetch --all
git reset --hard origin/{{your branch name}}

This worked for me, May be helpful for other.

@muriminyaga
Copy link

Yes this works..thanks

@Shravankumarhiregoudar
Copy link

Shravankumarhiregoudar commented Jul 1, 2019

Even after performing the above steps my issue was not solved.
So, unfortunately, I created a new folder and cloned.

git clone "_repo_path_"

@vidven09
Copy link

take this example:
$ git pull
error: The following untracked working tree files would be overwritten by merge:
deps/googletest/CMakeLists.txt
deps/libdwarf/CMakeLists.txt
deps/llvm/CMakeLists.txt
Please move or remove them before you can merge.
Aborting

What if I am OK to overwrite one file due to merge but want to retain my version for 2 other files?

@auxiliaryjoel
Copy link

I'm having this same problem, I tried:
git stash
git stash drop
git pull origin master
but it still results in the same warning:
error: The following untracked working tree files would be overwritten by merge:
web/themes/contrib/bootstrap_barrio/css/components/progress.css
web/themes/contrib/bootstrap_barrio/js/toast.js
web/themes/contrib/bootstrap_barrio/scripts/create_subtheme.sh
web/themes/contrib/bootstrap_barrio/templates/layout/maintenance-page.html.twig
Please move or remove them before you merge.
Aborting

How do I get around this?

@s3rvac
Copy link
Member

s3rvac commented Sep 2, 2019

@auxiliaryjoel I think that you are in the wrong project (we have never had any of the mentioned files in our repository). Are you sure that you are in a RetDec repository?

@auxiliaryjoel
Copy link

@s3rvac oh sorry for confusion I noticed the last person to comment on this was having the same problem (different files but the same problem). I was wondering if @vidven09 was able to resolve their issue. If they have, I think what worked for them may answer my issue?

@subhashree-r
Copy link

subhashree-r commented Sep 10, 2019

$ git add *
$ git stash
$ git pull origin master/{branch_name}

You will lose the local changes however.

@auxiliaryjoel
Copy link

oh ok so the :
$ git add *
I would do on the remote server that I'm intending to git pull to?

Danielkaas94 referenced this issue in Danielkaas94/Xenonauts-Mods Feb 5, 2020
Added in this commit:
    • New picture
        + Super Shotgun

A big applause and shoutout to mtkumar82:

    • git fetch --all
    • git reset --hard origin/{{your branch name}}
@alpizano
Copy link

git fetch --all
git reset --hard origin/{{your branch name}}

This worked for me, May be helpful for other.

omgthank you

@weberthmo
Copy link

run...
git add *
git pull origin master
git pull

@fisicaetcetera
Copy link

$ git add *
$ git stash
$ git pull origin master/{branch_name}

You will lose the local changes however.
My change was on remote. Worked fine. Thanks!

@rlynch99
Copy link

rlynch99 commented Mar 3, 2020

ok.. nothing too tough about it.. i had one file listed.. I deleted it, then did a git pull,
all good.
(if you need to, move the files to a different directory - not under git - and do the pull - you will always be able to move them back afterwards if needed.)

@s3rvac
Copy link
Member

s3rvac commented Mar 3, 2020

I am locking the issue as it has been solved and the newly appearing discussions are not related to RetDec.

@avast avast locked as resolved and limited conversation to collaborators Mar 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests