[git] Can't switch back to branch after unfreezing and freezing rails


it’s not directly Rails related, but as many Rails developers switched
to git, maybe someone can help.

I got an old app with frozen Rails that I wanted to refactor/update.
Checked it out from svn repo and initialized git repo for local
development, added everything and committed.

Switched from “master” to a new branch (“develop”) and then to another
one (“rails_update”). Being on “rails_update” I removed vendor/rails
and committed. Then I cloned rails git repo into vendor/rails,
switched to stable version 2.1.0 and committed these changes. Now I
can’t switch back to “develop” branch, because I get this error:

“fatal: Untracked working tree file ‘vendor/rails/.gitignore’ would be
overwritten by merge.”

If I remove this file, it complains about vendor/rails/actionmailer/
CHANGELOG - simply the first file it can find in vendor/rails dir.

Any ideas how to switch back to “develop” branch and merge changes
from “rails_update” branch? And how should I update Rails with git to
not get this strange error message again?

I’m not sure, but the first thing that occurs to me is that I removed
the .git directory after updating to Rails 2.1.0 because I’m not sure
you can have one git repo inside another. You should put back the
.gitignore file and try removing the .git directory in vendor/rails if
you do indeed still have one there.

Just guessing, but I hope that helps.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs