The Best Environment for Rails on Windows - Part 2
Posted on April 27, 2009
If you’re a Windows user new to this article, I recommend you start reading my original The Best Environment for Rails on Windows article from a few months ago, so you know what I am talking about.
Assuming you already have the Exuberant CTags and msysGit installed as described in my original article, then, once you get to the “Configuring gVim for Rails” section, you can avoid all those steps and just do this (on Windows):
1 2 3 4 5 6 |
cd %HOME% git clone git://github.com/akitaonrails/vimfiles.git cd vimfiles git submodule init git submodule update copy vimrc ..\_vimrc |
If you’re on Mac OS X or Linux you can do:
1 2 3 4 5 6 |
cd ~ git clone git://github.com/akitaonrails/vimfiles.git .vim cd .vim git submodule init git submodule update ln -s ~/.vim/vimrc ~/.vimrc |
I don’t quite remember all the shortcuts, but the ones that you will immediatelly need are:
1 2 |
Ctrl-F Open up FuzzyFinder (similar to Textmate Command-T) \-P Open up Nerd Tree (similar to the Project Pane in Textmate) |
If you’re a developer that had previously forked from my vimfiles repository, keep reading.
Git Conflicts
A few months ago I had forked from scrooloose’s repository and added several modifications, including a new set of snippets for the NERDSnippet plugin and configurations to respect Windows file path differences.
Scrooloose accepted my changes but instead of properly merging them into his repository, he copied the changes and made major changes to his repository. He decided that it would be better for maintenance to have the ‘snippets’ sub-directory be a separated git project, which is now here in Github. Then he replaced the original ‘snippets’ folder for a git submodule, linking both projects together.
Having no common ancestor no more, I was unable to easily merge back from his changes. I was getting this error whenever I tried to git pull —rebase or git pull -s resolve:
1 2 3 |
fatal: cannot read object c1a25b84627516da46b6c375f4dc874deedbb597 'snippets~a4c30e94d52232e958d4f53c6a633ed438c54bcc': It is a submodule! |
The actual commit refs are different, but this is the error message I was getting. Unfortunately I am no Git-expert yet so I didn’t know if there’s a better solution for this problem. So, what I ended up doing was hard resetting back to commit 7e2366c20fb19b5709369e77aa3bc095a869e1ce, which was the last known common ancestor for our repos. Then I git pulled from scrooloose, which brought me back on track with his, but also made me lose all my custom changes.
But as most of my work was on the snippets and he already merged them into the separated project, I decided I could lose my commits. Finally I manually added minor tweaks into just 3 files to make them compatible with Windows again and adding a little bit more of eye-candy for GUI-mode on Windows, Mac and Linux.
If someone knows how to resolve this kind of situation in git without having to resort to those drastic measures, please let me know, I still don’t know how to handle submodule situations with git. I hope this doesn’t disrupt too much of your work if you were forking from me.
blog comments powered by Disqus
Archives
- February 12(2)
- December 11(1)
- November 11(4)
- October 11(6)
- September 11(5)
- August 11(1)
- July 11(5)
- May 11(4)
- April 11(11)
- March 11(4)
- February 11(3)
- January 11(4)
- December 10(9)
- November 10(2)
- October 10(10)
- September 10(4)
- August 10(6)
- July 10(14)
- June 10(16)
- May 10(8)
- April 10(14)
- March 10(9)
- February 10(6)
- January 10(14)
- December 09(10)
- November 09(10)
- October 09(7)
- September 09(19)
- August 09(4)
- July 09(12)
- June 09(7)
- May 09(12)
- April 09(11)
- March 09(9)
- February 09(9)
- January 09(12)
- December 08(14)
- November 08(20)
- October 08(15)
- September 08(18)
- August 08(25)
- July 08(13)
- June 08(21)
- May 08(29)
- April 08(27)
- March 08(12)
- February 08(32)
- January 08(31)
- December 07(27)
- November 07(30)
- October 07(25)
- September 07(28)
- August 07(16)
- July 07(15)
- June 07(16)
- May 07(7)
- April 07(13)
- March 07(8)
- February 07(9)
- January 07(24)
- December 06(17)
- November 06(17)
- October 06(15)
- September 06(38)




