![]() I have all my code on my laptop, edit locally and automatically push the files to my server. I never edit "tracked" files on the server directly. I sometimes modify untracked files on the server using rmate (see below). SSH configĬreate a ~/.ssh/config file, which allows reusing existing connection. This mean that you will have to authenticate only once. Host serverĬheck that it works by running "ssh server" in a terminal. The second terminal shouldn't ask for credentials. This will also allow Sublime to connect to your server without asking for credentials. SFTP is a Sublime Text package that will allow you to keep in sync files on your laptop and on a server. This will create a sftp-config.json at the root of your project. (You may want to add sftp-config.json to your global gitignore). I recommend having the same project folder names on your server and on your laptop and keeping all your projects in the same folder. Use full paths here, SFTP doesn't handle shortcuts like ~ or $HOME. "remote_path": "/home/USER/github/YOUR_PROJECT ", #SUBLIME SFTP SETUP SERVER FULL# The status bar should show SFTP uploading the file to your server. SFTP will automatically upload files on save. (I'm not affiliated in any way with SFTP plugin) Adding rsync But if you modify files out of Sublime (eg git checkout, git pull), you will need to upload the whole folder: SFTP: Upload Folderĭon't forget to buy an SFTP license if you find this setup useful. Uploading the whole folder is often a bit slow. Using rsync will be faster, it only pushes the changed files. SFTP should switch to use rsync at some point, but in the meantime, I use the following command. Rsync -verbose -rd -del -exclude='.git/' -filter='. Note that this command is aggressive: -del means that files on the server but not on your laptop will be deleted, unless they are in the. The -del flag is useful if you rename a file locally. ST will upload the new version but won't remove the old one. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |