Easily Ignore CFBuilder Meta Files in a new Git Repo
When you create a new ColdFusion project in CFBuilder, you end up with 3 things in your project folder:
- A .project file -- this is par for the course in Eclipse
- A .settings folder
- And a settings.xml file
During the pre-release process I voiced my opinion that this was too much meta and that they should find a way to cut back or combine where possible. That hasn't happened. In addition, I complained that the file name "settings.xml" is too generic and quite likely to be something that the average developer would want to create for their project. This, too, seems to have fallen on deaf ears.
Oh well. Maybe next time.
However, in the meantime, I've created a quick shortcut for my Mac to create a new git repository and ignore all of the CFB Project Meta files all in one step. On Snow Leopard, edit the .profile file in your account folder (/Users/[your username]/.profile) and add this line:
alias cfgit="git init;echo '.project' >> .gitignore;echo '.settings' >> .gitignore;echo 'settings.xml' >> .gitignore;echo '.gitignore' >> .gitignore;git status"
It all has to be on one line to work properly, but I'll break down each command individually here so that it's easier to read.
alias cfgit="..."
Here we're creating a bash command alias. This translates to, "When I type cfgit I want you to do [this] instead." Where [this] is what you put inside the quotation marks. You can put multiple commands here as long as you separate them with a semicolon.
echo '.project' >> .gitignore; echo '.settings' >> .gitignore; echo 'settings.xml' >> .gitignore; echo '.gitignore' >> .gitignore;
Each of these appends a new line to the file .gitignore with the contents of the single-quotation marks; so in this case it's adding a new line for .project, .settings, settings.xml, and .gitignore (ignore itself). By using >> instead of >, you append to the file if it exists, or create it otherwise. If you're unaware, the .gitignore file tells the local git client which files in the folder are to be excluded from the repository.
Lastly, it runs git status to show the current status of the folder/repository; mostly just as a sanity check to make sure that everything that I want to have happened has.
Posted in Apple | CFBuilder | Git | 4 Responses
preferably one with an eclipse plugin like egit
Every now and then I try to setup Git on Windows and while it works, it still feels clunky to me. For that reason, I tend to just use Egit in CFBuilder when I'm on Windows.
I'm not sure what you're looking for in a setup tutorial. Can you be more specific in your question?
and is it the only one eGIT connects to?
thanks
Jgit < http://www.eclipse.org/jgit/ > is a java library for interacting with Git; and is used by Egit.
If you want to integrate a Git client into your Eclipse installation, install Egit.
Just as with other source control system (e.g. Subversion) you still need a repository to work with, in addition to the client.
That's about the limit of how far I want to discuss getting started with Git here. If you still need to know more, I would suggest you seek out tutorials on getting started with Git, of which there are many available at Github: http://help.github.com/