I have a few different machines I use throughout the day, and I use git to pull down the most recent code on my projects.
However, my Sublime Text installs are different on each machine, and I can't keep my packages straight. My Sublime Text 3 preferences/packages are stored in ~/Library/Application Support/Sublime Text 3.
Is there a way to store my preferences in Github so I can pull them down on other machines? I'm nervous about doing this and am wondering if anybody else has done this before.
Package Control/User
You only need to add the ~/Library/Application Support/Sublime Text 3/Package Control/User/
(or on Windows: C:\Users\{username}\AppData\Roaming\Sublime Text 3\Packages\User
) directory.
From https://packagecontrol.io/docs/syncing
The proper solution is to install Package Control on all machines and then to sync only the Packages/User/ folder. This folder contains the Package Control.sublime-settings file, which includes a list of all installed packages. If this file is copied to another machine, the next time Sublime Text is started, Package Control will install the correct version of any missing packages.
Create a new repo on github, name it something like "sublime-prefs", then run these commands:
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User
git init
git add Package\ Control.sublime-settings
git commit -am "settings from from <device name>"
git remote add origin https://github.com/<github name>/<repo name>.git
git push -u origin master
Quit Sublime Text 3, then run these commands (using answer from How do I clone into a non-empty directory?):
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/
git init
git remote add origin https://github.com/<github name>/<repo name>.git
rm Package\ Control.sublime-settings
git fetch
git checkout -t origin/master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With