Using Nettuts-Fetch to create .gitignore files in Sublime Text

When creating a new repository, the first step is to create a .gitignore file. Simple enough, right? Well, that is until your team members start contributing code and adding unusal files because you’ve forgotten they use that editor.

I use a simple method to get around this problem. I host .gitignore files on GitHub. This means anyone on my team can contribute: if they install a new editor, they just add any editor-related files to the repo (or any other files that need to excluded from the repository).

I then use the Sublime Text plugin Nettuts-Fetch to quicky create the .gitignore file.

To set this up, create a GitHub repository to host your .gitignore files. I currently have two: a standard .gitignore file and a WordPress .gitignore file. You can have as many as you need.

Next, install the Nettuts-Fetch plugin. Once installed, bring up the command palette and select ‘Fetch: Manage’. A json file will open, just enter something like the following in the files section:

	"gitignore - standard": "",
	"gitignore - wordpress": ""

Change the names and repository paths as required. Next, create a new file and then open the command palette and select ‘Fetch: File’. You can then select the .gitignore file you require (as shown below). Save the file as .gitignore and you’re done.

Sublime Text Fetch Plugin