I have a github repo that has not been pushed to in a couple months (I know, bad idea) during which time a fair amount of development has been done. I went to push to the repo and I received this error:
error: failed to push some refs to
https://github.com/SteelcaseEbiz/PDE_UI_engine.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
This is not a duplicate. I asked a very specific question, see below, which no one has answered.
If I were to pull like it's suggesting, would I be pulling the old version down thus overwriting all of the changes I've made?
The message given by Git is the important one but it's more important to understand what it is saying beyond just the text on the screen.
Basically, this is the situation: In that remote repository, there are commits on the branch you tried to push to that you don't have locally.
Whether you originally avoided fetching them or they have been added into that repository after you last fetched from it is unimportant, the important bit is that they're there, and you don't have them.
So to answer your question, we cannot really answer your question of what is going to happen if you pull/merge those commits into your local repository.
The following scenarios are all possible, and there probably more scenarios conceivable as well:
In short, it is impossible for us to tell you what the outcome will be.
But fear not, one of the big things I'm a fan of with Git is that you can experiment.
So do the following:
Worse case scenario: You destroy that copy/clone. If you think you simply messed up, destroy the clone and try again. If you think the two repositories cannot be reconciled with a merge, you now have your answer as to what will happen.
Note that you do not really have to operate on a clone, you can clean up a botched merge in your real local repository, but I advise this anyway so that you're surer that you won't accidentally destroy anything important.