On Wed, Oct 3, 2012 at 3:54 PM, Jeffery Brewer <jeffery.bre...@gmail.com> wrote:
> I have files I move around between several different environments, and in
> each environment I have a config file (web.config) that is unique to each
> environment.
> I make changes on my machine, push them to a repository, move to a
> development machine and "pull" them from the repository, then move them to
> to a test machine and "pull" them from the repository, etc.
> Through some trial and error I figured out that "most of the time" if I put
> my web.config into my .gitignore file everything works fine, but not always.
> Right now I'm spending my afternoon trying to figure out why whenever I
> checkout the "master" branch it deletes my web.config file. It happens like
> this. I will have my web.config file in my directory and then checkout a
> branch into that directory (e.g. git checkout new-search) and everything is
> fine. If I switch to another branch (e.g. git checkout fix-search)
> everything is fine as well. But when I check out the master branch (e.g. git
> checkout master) it deletes my web.config file.
> Why is it deleting my config file and more importantly, how can I get it to
> stop doing that so that I can spend my time working on code and not fussing
> with git?

My guess is that web.config is committed in the fix-search branch.
When you switch to fix-search, that version of web.config is written
to the working tree (overwriting the file that was there, which was
ignored and therefore uninteresting, so Git didn't bother to tell you
about it).  Then when you switch from fix-search to master, Git checks
to see if web.config in the working tree is the same as it is in
fix-search.  If so, then there are no changes to deal with when
switching branches, and it can be safely updated to its 'master' state


Gehm's Corollary to Clark's Law: Any technology distinguishable from
magic is insufficiently advanced.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to