<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>This is ZX81.org.uk</title><link>https://www.zx81.org.uk/</link><description>Recent blog posts on This is ZX81.org.uk</description><generator>Hugo (https://gohugo.io)</generator><language>en</language><lastBuildDate>Tue, 07 Apr 2015 21:23:13 +0800</lastBuildDate><atom:link href="https://www.zx81.org.uk/tags/git/index.xml" rel="self" type="application/rss+xml"/><item><title>The 'D' in 'DVCS'</title><link>https://www.zx81.org.uk/posts/2015-04-07-the-d-in-dvcs/</link><pubDate>Tue, 07 Apr 2015 21:23:13 +0800</pubDate><author><name>Stephen Darlington</name><uri>https://www.zx81.org.uk/</uri></author><description>&lt;p&gt;Last week, GitHub was the victim of a &lt;a href="https://github.com/blog/1981-large-scale-ddos-attack-on-github-com" target="_blank" rel="noopener noreferrer"&gt;days long denial of service attack&lt;/a&gt; that meant that it wasn’t available reliably despite the hard work of their team.&lt;/p&gt;
&lt;p&gt;What surprised me was the number of people on Twitter complaining that they couldn’t work. I was surprised because one of the key things about Git (the tool rather than the website) is that it is &lt;em&gt;distributed&lt;/em&gt;, that is there is no centralised server in the way that there is with, say, Subversion. Clearly there are things you &lt;em&gt;can’t&lt;/em&gt; do without GitHub – most obviously downloading new repositories – but almost everything else can be done peer-to-peer. The rest of this post explains how.&lt;/p&gt;
&lt;p&gt;First, a couple of disclaimers. I’m not a Git expert and I’m not a server admin. There certainly are other ways of doing this. Some may even be more secure or easier in &lt;em&gt;your&lt;/em&gt; environment. What I like about this approach is that it works on pretty much any machine that has git installed.&lt;/p&gt;
&lt;p&gt;Step one: set up a Git server.&lt;/p&gt;
&lt;p&gt;“Woah, now,” you’re thinking, “I don’t have all day!”&lt;/p&gt;
&lt;p&gt;Turns out it’s just two commands:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;touch &amp;gt; .git/git-daemon-export-ok
git daemon
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;(Assuming you’re in the folder that’s at the root of the repository you want to export.)&lt;/p&gt;
&lt;p&gt;Then on your other PC you can enter the following command to pull or push:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;git pull git://othermachine/Users/stephend/temp/
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You could even clone a repo to a local server, run a git server on it and use it as a temporary ’central’ repository.&lt;/p&gt;
&lt;p&gt;If there’s a downside it’s that it’s difficult to recommend &lt;em&gt;pushing&lt;/em&gt; to a repository using this method because there’s no authentication. However, as a quick and dirty way of pulling commits between any two machines with git installed it’s pretty reliable.&lt;/p&gt;
&lt;p&gt;(If you know git you’re probably thinking “Why not ssh?” The short version is that it’s often locked down in corporate machines and is usually not available on Windows machines. But if you &lt;em&gt;can&lt;/em&gt; use it you probably should.)&lt;/p&gt;</description><guid isPermaLink="true">https://www.zx81.org.uk/posts/2015-04-07-the-d-in-dvcs/</guid></item></channel></rss>