Files
.com/remote-textmate-development-via-ssh-and-rsync.html
Kenneth Reitz 8f3f30005c content update
2011-01-03 00:33:11 -05:00

209 lines
7.3 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Remote TextMate Development via SSH and Rsync</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="./theme/css/main.css" type="text/css" />
<link href="./feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Kenneth's log ATOM Feed" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" media="all" href="./css/ie.css"/>
<script src="./js/IE8.js" type="text/javascript"></script><![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" media="all" href="./css/ie6.css"/><![endif]-->
</head>
<body id="index" class="home">
<a href="http://github.com/kennethreitz/">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" />
</a>
<header id="banner" class="body">
<h1>
<a href=".">Kenneth's log </a>
</h1>
<nav><ul>
<li >
<a href="./category/Life.html">Life</a>
</li>
<li class="active">
<a href="./category/Code.html">Code</a>
</li>
<li >
<a href="./category/projects.html">projects</a>
</li>
</ul></nav>
</header><!-- /#banner -->
<section id="content" class="body">
<article>
<header> <h1 class="entry-title"><a href="remote-textmate-development-via-ssh-and-rsync.html"
rel="bookmark" title="Permalink to Remote TextMate Development via SSH and Rsync">Remote TextMate Development via SSH and Rsync</a></h1> </header>
<div class="entry-content">
<footer class="post-info">
<abbr class="published" title="2009-05-08T00:39:00">
Fri 08 May 2009
</abbr>
<p>In <a href="./category/Code.html">Code</a>.
</p>
</footer><!-- /.post-info -->
<p>I am a huge fan of
<a class="reference external" href="http://kennethreitz.com/blog/if-textmate-42/">TextMate</a>. In my
opinion, it is by far the greatest text editor ever conceived by
mankind. It has a couple of shortcomings, however. One of which is
that it has no built-in FTP or SFTP support. Remote file editing is
a bit of a bear here if you like to view folders in the project
drawer on the side. <img alt="image" src="http://media.kennethreitz.com/images/textmate-logo.png" />
<strong>Options for remote editing with TextMate:</strong> - Cyberduck FTP
client - MacFUSE + SSHFS - Rsync + SSH</p>
<div class="section" id="cyberduck">
<h2>Cyberduck</h2>
<p><strong>The `Cyberduck &lt;http://david.olrik.dk/files/Synchronize_remote_directory_rsync_ssh.zip&gt;`_ option is very very useful. While in the FTP client, you simply click &quot;Edit in TextMate&quot; and the client will download the file for you, open it in your editor, and here's the awesome part it automatically uploads the file every time you save it. This works great when working with one file at a time. The drawback, however, is when working with large projects. Toggling between many files can be an albatross without the project drawer (cyberduck understandably doesn't allow you to edit an entier folder), so MacFUSE is the next logical choice.</strong>
## MacFUSE + SSHFS</p>
<p><a class="reference external" href="http://www.pqrs.org/tekezo/macosx/sshfs/">MacFUSE</a> + SSHFS works
great, and allows you to mount an SSH folder as a mountpoint on
your local system. VERY USEFUL. You can open this folder with
TextMate. This is perfect for smaller projects. However, with
larger projects, this makes opening the folder in TextMate almost
unbearable as it checks the status of every single file. Too slow
:P ## Rsync + SSH</p>
<p><strong>So here's the final solution: Rsync + SSH. This allows me to automatically sync my working copy with my server and allow for snappy file interactions without having insane latencies for starting up and bandwidth hogging!</strong>
To remotely sync over SSH, run the following code: rsync -avz -e
ssh <a class="reference external" href="mailto:remoteuser&#64;remotehost">remoteuser&#64;remotehost</a>:/remote/dir /target/dir/</p>
<p><strong>Hint</strong>: If your remote working copy is a subverson checkout, you
can add --cvs-exclude</p>
<div class="system-message">
<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">&lt;string&gt;</tt>, line 2); <em><a href="#id1">backlink</a></em></p>
Duplicate explicit target name: &quot;textmate&quot;.</div>
<p>into the rsync parameters, and it will exclude the &quot;.svn&quot; folders!
You can then open this directory in TextMate and make all the
changes you want, and then sync after ! There is also a wonderful
TextMate Bundle for
<a class="reference external" href="http://david.olrik.dk/files/Synchronize_remote_directory_rsync_ssh.zip">Remote Rsync + SSH within TextMate</a>.
<a class="reference external" href="http://technorati.com/tag/Development">Development</a>,
<a class="reference external" href="http://technorati.com/tag/OSX">OSX</a>,
<a class="reference external" href="http://technorati.com/tag/rsync">rsync</a>,
<a class="reference external" href="http://technorati.com/tag/TextMate">TextMate</a></p>
</div>
</div><!-- /.entry-content -->
<div class="comments">
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_identifier = "remote-textmate-development-via-ssh-and-rsync.html";
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://kennethreitz.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</div>
</article>
</section>
<section id="extras" class="body">
<div class="blogroll">
<h2>Links</h2>
<ul>
<li><a href="http://github.com/kennethreitz">GitHub Repos</a></li>
<li><a href="http://flickr.com/kennethreitz">Photography (Flickr)</a></li>
<li><a href="http://twitter.com/kennethreitz">Latest Tweets</a></li>
<li><a href="http://www.linkedin.com/in/kennethreitz">R&eacute;sum&eacute;</a></li>
<li><a href="http://pick.im/kenneth-reitz">Design Portfolio</a></li>
<li><a href="http://laterstars.com/kennethreitz">Later Stars</a></li>
</ul>
</div><!-- /.blogroll -->
<div class="social">
<ul>
<li><a href="./feeds/all.atom.xml" rel="alternate">atom feed</a></li>
<li><a href="http://facebook.com/kennethreitz">Facebook</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<address id="about" class="vcard body">
&copy; 2011 Kenneth Reitz &amp; co. All Rights Reserved.
</address><!-- /#about -->
</footer><!-- /#contentinfo -->
<script type="text/javascript">
var disqus_shortname = 'kennethreitz';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<script type="text/javascript" charset="utf-8">
var disqus_developer = 1;
</script>
</body>
</html>