2

I have a remote linux development server and I use winscp to edit files via ssh. I have chosen sublime as default editor for winscp. However i cannot think of a good way to have git support in sublime (e.g. sublimegit or gitgutter) with this setup. The development server has git installed and configured.

I could install X11 on my linux server and install there sublime but i would like to avoid this option.

Is there a better way to integrate git with sublime when working on a remote filesystem and not a local one?

Nikos Tsagkas
  • 1,287
  • 2
  • 17
  • 31
  • The usual git way would be to make a local clone of the git repository and use `git pull / git push` to sync with the remote copy. Can you elaborate on the "do not work on a local clone" part ? – LeGEC Aug 06 '14 at 12:49
  • hi, thanks for your answer. My problem is that my local machine is a windows machine and i dont want to install and configure servers on it. Therefore i have everything on another linux server machine that i use for development. However I want to edit files via sublime on my windows machine (thus via ssh with the help of winscp) – Nikos Tsagkas Aug 06 '14 at 15:08

1 Answers1

0

You don't need to install a server to communicate with a git repository. A simple ssh connection is enough :

git clone user@sshserver:/path/to/git/project

will clone the given remote project on your local machine, and store user@sshserver:/path/to/git/project as the origin.

You can then use the regular commands git push origin / git pull / git fetch to sync with the remote repository.
Depending on your ssh setup, you may have to type your user password each time you execute a "syncing" command - if you want to avoid that, set up an ssh key for your regular ssh account.


Don't forget, on your windows machine, to tell git to take care of line endings :

git config --global core.autocrlf true

See git replacing LF with CRLF for more details.

Community
  • 1
  • 1
LeGEC
  • 46,477
  • 5
  • 57
  • 104
  • A complete git server, such as `gitolite`, would give you finer control on the user list and access rights, but you don't *need* it to communicate with a git repository. – LeGEC Aug 07 '14 at 09:36
  • Thank you for your answer. Actually when mentioned servers i meant web application servers (e.g. apache or node). I dont want to install an apache on my windows machine and thus I use a virtual machine for my development. The development vm has already git installed configured and i know how to use it via the command line. I was wondering if my text editor on my windows machine (i.e. sublime) can communicate somehow with the vm to get git info and present them nicely so i can see changes etc. – Nikos Tsagkas Aug 07 '14 at 14:32
  • 1
    @NikosBelibemTsagkas : mount the vm's folder as a nfs folder on your windows system ? – LeGEC Aug 08 '14 at 13:18