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

**URL:** <https://www.ruby-forum.com/t/git-cant-switch-back-to-branch-after-unfreezing-and-freezing-rails/142034>\
**Category:** Rails\
**Created:** [July 2, 2008, 8:22pm UTC](https://www.ruby-forum.com/t/git-cant-switch-back-to-branch-after-unfreezing-and-freezing-rails/142034 "2008-07-02T20:22:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![g0nzo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3bc359/32.png) [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Post date:** [July 2, 2008, 8:22pm UTC](https://www.ruby-forum.com/t/git-cant-switch-back-to-branch-after-unfreezing-and-freezing-rails/142034/1 "2008-07-02T20:22:47Z")

</div>

Hi,

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?

---

<div class="post-metadata">

**Author:** ![g0nzo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3bc359/32.png) [@g0nzo](https://www.ruby-forum.com/u/g0nzo)\
**Post date:** [July 2, 2008, 10:30pm UTC](https://www.ruby-forum.com/t/git-cant-switch-back-to-branch-after-unfreezing-and-freezing-rails/142034/2 "2008-07-02T22:30:49Z")

</div>

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.

Regards,  
Craig
