ga-wdi-exercises / pbj-project3

[project]
0 stars 2 forks source link

Having issue pulling from git due to untracked file env.js #58

Closed pdoulatshahi closed 9 years ago

pdoulatshahi commented 9 years ago

Having an issue

error: The following untracked working tree files would be overwritten by merge:
    env.js
when I am trying to pull latest changes from git.

We have already deployed and we have made changes to the ignored env.js file, but I have manually updated those changes.

RobertAKARobin commented 9 years ago

That means you've made some changes, and Git won't let you merge in stuff because it would write over the changes you made. The solution is to git commit your changes, or if you don't want to commit them, use git stash which sort-of "saves" stuff without committing.

msteffan commented 9 years ago

We actually tried both of those fixes already; he got that error when he tried to pull after committing his own changes. git stash also didn't do anything. The only other "solution" we were finding was to git revert head but we don't want to overwrite his changes with what gets pulled.

RobertAKARobin commented 9 years ago

You need to git add before you git stash.

If that doesn't work, checkout to a new branch and commit his changes there.

pdoulatshahi commented 9 years ago

So I'm doing git add . and then git stash and then git pull. Same error.

On Thu, Aug 27, 2015 at 5:25 PM, Robert Thomas notifications@github.com wrote:

You need to git add before you git stash.

— Reply to this email directly or view it on GitHub https://github.com/ga-dc/pbj-project3/issues/58#issuecomment-135558517.

Paul Doulatshahi (206) 818-5550

pdoulatshahi commented 9 years ago

Deleted env.js and then did normal git add/commit/pull/merge/push. All good now. And I now have env.js again.