前提
- Gitがインストールされていること
- GitHub等のGitホスティングサービスのアカウントを持っていること
手順
-
既にSublimeTextを使用中の場合は、C:\Users\UserName\AppData\Roaming\Sublime Text 3\Packages\Userの中身を別のディレクトリへ退避し、SublimeTextをアンインストールする
-
SublimeTextをインストールする
-
C:\Users\UserName\AppData\Roaming\Sublime Text 3\Packages\Userで以下のコマンドを実行し、ローカルリポジトリを作成。
git init
-
ローカルリポジトリに最初のcommit(空commitにする)
参考: Gitの最初のコミットは空コミットにしよう - Qiitagit commit --allow-empty -m "first commit"
-
.gitignoreファイルの作成
参考: Windowsエクスプローラーでドットファイルを作成する - Qiita作成例*.errors.log 1self.sublime-settings encoding_cache.json oscrypto-ca-bundle.crt Package Control.last-run Package Control.merged-ca-bundle Package Control.system-ca-bundle Package Control.user-ca-bundle c2u_tmp/ ColorPicker/ Color Highlighter/themes/ Package Control.cache/
-
ローカルリポジトリにcommit
git add . git commit -m "second commit"
-
Gitホスティングサービス上でリモートリポジトリを作成
-
リモートリポジトリを登録
githubの場合git remote add origin git@github.com:username/reponame.git
Bitbucketの場合git remote add origin https://username@bitbucket.org/username/reponame.git
-
ローカルリポジトリからリモートリポジトリへpush
git push -u origin master
-
1で退避したファイルを、C:\Users\UserName\AppData\Roaming\Sublime Text 3\Packages\Userに上書きする
バージョン管理の対象ファイル
Default (Windows).sublime-keymap
Preferences > Key Bindings から開ける、キーバインドの設定ファイル
Package Control.sublime-settings
Package ControlからインストールしたPackageの一覧が記録されるファイル
SublimeTextは、起動時にこのファイルを読み込み、最新バージョンのPackageをダウンロードするようになっています
Preferences.sublime-settings
Preferences > Settings から開ける、SublimeText全体の設定ファイル
{Package名}.sublime-settings
Preferences > Package Settings から開ける、Packageごとの設定ファイル
{言語名}.sublime-settings
Preferences > Syntax Specific から開ける、言語ごとの設定ファイル
その他ファイル
- *.sublime-build (自作のbuild設定)
- *.sublime-snippetsnippet (自作のsnippet)
- *.tmTheme (カラースキーム)
- *.sublime-macro (自作のマクロ)
- その他自作のファイル
#リンク
Syncing - Package Control
mokmokjp/sublime_settings - GitHub