-1

Locally (Cloud9), I have commited my changes to my repo (https://github.com/edward408/my-first-blog), however when i perform a git pull on my deployment server (PythonAnywhere) i get the following error:

Updating aef1181..5d68bfa
error: Your local changes to the following files would be overwritten by merge:
        db.sqlite3
Please, commit your changes or stash them before you can merge.
Aborting

I have pushed the changes from my local console (Cloud9) and made sure by veryfing git status afterwards. It seems that the best path long-term is to updatede git on PythonAnywhere while updating it from my local git at the same time. However, how would I implement that without starting a new repo again? Id prefer not to change anything that I already have on PythonAnywhere.

Anywho, what would the best feasible solution at this point in time?

EDITED: Its not completely the same as the suggested link. I already have my local dev environment pushing updates to the project repo. To use git stash on PythonAnywhere, i would have to push from there as well. Unless this means executing stash locally?

user40720
  • 89
  • 1
  • 2
  • 9
  • possible duplicate of [Ignoring "Your local changes to the following files would be overwritten by merge" on pull](http://stackoverflow.com/questions/14318234/ignoring-your-local-changes-to-the-following-files-would-be-overwritten-by-merg) – kenorb Aug 30 '15 at 22:56

1 Answers1

3

All that means is db.sqlite3 has been modified on your production server. Because of this, git isn't sure whether it is ok to overwrite it with your new code (because that file is present in your repo). Really, you should just add that file to your .gitignore, but you can get around it with (on your production server) running:

git stash
# do your pull
git stash pop

Basically, stash "saves" modified files that haven't been committed and allows you to later restore it by popping it off again, after the merge has overwritten it. https://git-scm.com/book/en/v1/Git-Tools-Stashing

Ryan Gaus
  • 94
  • 2
  • 2
  • 1
    wouldn't that add another layer to the repo (doing it from the production server). When i execut git stash it says "Tell me about you" meaning i would have to link to the repo from PA. – user40720 Aug 30 '15 at 23:10