Technology Errors

git: Error: Some Local Refs Could Not Be Updated; Try Running ‘git remote prune origin’ To Remove Any Old, Conflicting Branches

Lately I have been working on a Ruby project that has a bunch of different branches that various developers are working on. One of the development servers has multiple virtual hosts and at certain points in the code release cycle the various virtual hosts could be completely split from the main branch of Ruby code either because of a bug fix, a specific feature, or any number of other reasons. The other night I needed to bring one of the virtual hosts to a near production release to test some features of a product that uses the web application to record data and when I attempted to “git pull” I received an error which is described in detail below along with what I ended up doing to resolve the problem.

Technology Insights

Creating remote branches from local ones in Git

I had an existing local branch that I had done some commits to and wanted to create a remote branch on origin so that I could check it out to other local branches on different machines. The current version of Git (1.6.1.x at the time of this writing), doesn’t seem to have an elegant way of doing this, but still I was able to do it fairly simply by manually editing Git’s “config” file (inside of the “.git” folder of a working directory).