SourceTree pull error

3.5k Views Asked by At

I get an error when I do a pull to my local repository. Here is the error log:

git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin

git -c diff.mnemonicprefix=false -c core.quotepath=false pull --no-commit origin master
From https://bitbucket.org/svalecillos/sistemanomastattut
 * branch            master     -> FETCH_HEAD

error: Your local changes to the following files would be overwritten by merge:
    app/Http/Controllers/Auth/AuthController.php
    config/app.php
    resources/views/auth/login.blade.php
    resources/views/auth/register.blade.php
Please commit your changes or stash them before you merge.



error: The following untracked working tree files would be overwritten by merge:
    resources/views/emails/password.blade.php
Please move or remove them before you merge.
Aborting



Completed with errors, see above.
1

There are 1 best solutions below

0
Peet Brits On

Everything you need to know is in the error log you provided.

1. Modified local files

error: Your local changes to the following files would be overwritten by merge:
    (...)
Please commit your changes or stash them before you merge.

2. New local files not yet in git

error: The following untracked working tree files would be overwritten by merge:
    (...)
Please move or remove them before you merge.

Suggestions

  1. What I usually do in this situation is to stash my local changes, do the pull, and then apply the stash and merge any conflicts.

  2. For local new / untracked files, make a backup of your file, delete it locally, and then after the pull you can compare it with the pulled file. (TIP: If you stage an untracked file before you stash, it will become part of the stashed files.)