Sublime Forum

Preserving ST3 configuration in source control

#1

I had a problem earlier today that I was able to solve by nuking my ~/.config/sublime-text-3 directory and starting over. It was quite painful, and it got me thinking: ideally, I would like to start keeping my ST3 config in a git repo. Then I can easily keep track of changes over time, and restore from old versions when necessary.

ST3 keeps a lot of files in the sublime-text-3 directory. My question is: which files from my config would I need to commit to git, in order that I could just do a git clone to set up a new ST3 installation that’s exactly like my current setup, (once cached files had been re-downloaded etc)?

0 Likes

#2

https://packagecontrol.io/docs/syncing

4 Likes

#3

This was of the first thing I started doing when I started using Sublime Text. I got all my settings on GitHub. I created a very easy and fast way to install them. These are the steps: https://github.com/evandrocoan/SublimeTextStudio#installation

You may use the same steps for your settings. What you need to know is that I not syncing the User folder, but the Packages folder. This is because my settings go beyond the User folder. I also configure individually several packages. The most reason for this is their intromission on my context menu. As there are for now 65 packages installed, If I allow the package’s author put everything they want to on my context menu or whatever else, it definitely does not fit on my screen when I open it, beyond became a complete mess. So, what I did was to remove some and add the rest to submenus.

You need to carefully configure the .gitignore files to not allow anything private pass/leak. So, settings which involves private keys, etc, must not be synced, unless you git repository is private. You also, should not let pass packages dependencies, and other stuff the Package Control download for your, the first time you open your Sublime Text.

I am also shipping the Package Control as a git submodule from my fork, this is because I need two lines added into its source, otherwise it does not work to sync and install correctly my settings. I did a pull request, but it is stuck for merge/approval: https://github.com/evandrocoan/SublimeTextStudio/issues/6. Nevertheless, now it is easier to install the settings, as you do not need to install the Package Control.

But be aware about this issue: The Package Control ignore some packages some times when installing the settings

1 Like

#4

I use a mix of git submodules and Package Control for my sublimefiles. I like being able to control the entire Packages directory too, rather than just the User directory.

I also regularly use a sublime cleaner script. I almost always run that after an update to save from any issues. I know I lose some of the goodness by blowing away the caches, and index, etc, but it’s a trade-off. I find I have less issues by just cleaning everything after an update.

2 Likes

#5

Some great suggestions. Thanks all!

0 Likes