{"id":421,"date":"2012-04-24T17:03:10","date_gmt":"2012-04-24T15:03:10","guid":{"rendered":"http:\/\/joernhees.de\/blog\/?p=421"},"modified":"2016-09-28T23:23:14","modified_gmt":"2016-09-28T21:23:14","slug":"git-ad-hoc-sharing","status":"publish","type":"post","link":"https:\/\/joernhees.de\/blog\/2012\/04\/24\/git-ad-hoc-sharing\/","title":{"rendered":"Git ad-hoc sharing"},"content":{"rendered":"<p>I recently found quite a cool way for easy sharing sharing of git code between two machines in a LAN or WLAN (as easy as in mercurial). The following command creates a git alias called &#8220;serve&#8221; (you only need to run this once so you don&#8217;t have to manually call <code>git daemon ...<\/code> each time):<\/p>\n<pre><code class=\"bash\">git config --global alias.serve 'daemon --reuseaddr --base-path=. --export-all --verbose'\n<\/code><\/pre>\n<p>Get your IP with <code>ifconfig<\/code>. After this you can just <code>cd<\/code> into your code directory, (where the .git dir is)  and then run:<\/p>\n<pre><code class=\"bash\">git serve\n<\/code><\/pre>\n<p>This will host a small git daemon (server) and you can stop it any time with CTRL+C. While still running simply run this from the fetching computer (client):<\/p>\n<pre><code class=\"bash\">git clone git:\/\/the_server_ip\/\n<\/code><\/pre>\n<p>You can also run the server in a parent directory and actually serve multiple git repositories. If you do you need to include the relative path information to the .git-dir containing directory on the client side:<\/p>\n<pre><code class=\"bash\">git clone git:\/\/the_server_ip\/your\/subdirs\/here\/\n<\/code><\/pre>\n<p>Subsequent calls like <code>git fetch<\/code> should also work. If the IP changes just change the origin remote&#8217;s link.<\/p>\n<p>For more you might want to have a look at these:<br \/>\n<a href=\"http:\/\/stackoverflow.com\/questions\/5817095\/what-tools-exist-for-simple-one-off-sharing-of-a-git-repo\" target=\"_blank\">http:\/\/stackoverflow.com\/questions\/5817095\/what-tools-exist-for-simple-one-off-sharing-of-a-git-repo<\/a><br \/>\n<a href=\"http:\/\/stackoverflow.com\/questions\/377213\/git-serve-i-would-like-it-that-simple\" target=\"_blank\">http:\/\/stackoverflow.com\/questions\/377213\/git-serve-i-would-like-it-that-simple<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently found quite a cool way for easy sharing sharing of git code between two machines in a LAN or WLAN (as easy as in mercurial). The following command creates a git alias called &#8220;serve&#8221; (you only need to run this once so you don&#8217;t have to manually call git daemon &#8230; each time): [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[2],"tags":[6,25,26,40,41,53,135,142,148,150],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pYA5n-6N","jetpack-related-posts":[{"id":346,"url":"https:\/\/joernhees.de\/blog\/2011\/03\/08\/latexthesis-skeleton\/","url_meta":{"origin":421,"position":0},"title":"LaTeX Thesis Skeleton","date":"2011-03-08","format":false,"excerpt":"As it might be useful for other students (especially for computer science students at the University of Kaiserslautern), I decided to invest some time and create a skeleton for a thesis. The project can be found on github: http:\/\/github.com\/joernhees\/thesis-skeleton. I'll happily include \/ pull changes. Quick instructions to get started\u2026","rel":"","context":"In \"bachelor\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":442,"url":"https:\/\/joernhees.de\/blog\/2012\/05\/25\/setting-up-a-local-dbpedia-3-7-mirror-with-virtuoso-6-1-5\/","url_meta":{"origin":421,"position":1},"title":"Setting up a local DBpedia 3.7 mirror with Virtuoso 6.1.5+","date":"2012-05-25","format":false,"excerpt":"Newer version available: Setting up a Linked Data mirror from RDF dumps (DBpedia 2015-04, Freebase, Wikidata, LinkedGeoData, ...) with Virtuso 7.2.1 and Docker (optional) Nearly 1.5 years after i initially published a post about how to setup a local DBpedia mirror i recently revisited the problem myself to setup a\u2026","rel":"","context":"In &quot;Coding&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":731,"url":"https:\/\/joernhees.de\/blog\/2015\/11\/23\/setting-up-a-linked-data-mirror-from-rdf-dumps-dbpedia-2015-04-freebase-wikidata-linkedgeodata-with-virtuoso-7-2-1-and-docker-optional\/","url_meta":{"origin":421,"position":2},"title":"Setting up a Linked Data mirror from RDF dumps (DBpedia 2015-04, Freebase, Wikidata, LinkedGeoData, ...) with Virtuoso 7.2.1 and Docker (optional)","date":"2015-11-23","format":false,"excerpt":"So you're the guy who is allowed to setup a local DBpedia mirror or more generally a local Linked Data mirror for your work group? OK, today is your lucky day and you're in the right place. I hope you'll be able to benefit from my many hours of trials\u2026","rel":"","context":"In &quot;Coding&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":277,"url":"https:\/\/joernhees.de\/blog\/2010\/10\/31\/setting-up-a-local-dbpedia-mirror-with-virtuoso\/","url_meta":{"origin":421,"position":3},"title":"Setting up a local DBpedia mirror with Virtuoso","date":"2010-10-31","format":false,"excerpt":"So you're the guy who is allowed to setup a local DBpedia mirror for your work group? OK, today is your lucky day and you're in the right place. I hope you'll be able to benefit from my hours of trials and errors ;)","rel":"","context":"In &quot;Coding&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":584,"url":"https:\/\/joernhees.de\/blog\/2014\/04\/23\/setting-up-a-local-dbpedia-3-9-mirror-with-virtuoso-7\/","url_meta":{"origin":421,"position":4},"title":"Setting up a local DBpedia 3.9 mirror with Virtuoso 7","date":"2014-04-23","format":false,"excerpt":"Newer version available: Setting up a Linked Data mirror from RDF dumps (DBpedia 2015-04, Freebase, Wikidata, LinkedGeoData, ...) with Virtuso 7.2.1 and Docker (optional) I just found this aged post in my drafts folder, maybe someone will still like it... So you're the guy who is allowed to setup a\u2026","rel":"","context":"In &quot;Coding&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":610,"url":"https:\/\/joernhees.de\/blog\/2014\/11\/10\/setting-up-a-local-dbpedia-2014-mirror-with-virtuoso-7-1-0\/","url_meta":{"origin":421,"position":5},"title":"Setting up a local DBpedia 2014 mirror with Virtuoso 7.1.0","date":"2014-11-10","format":false,"excerpt":"Newer version available: Setting up a Linked Data mirror from RDF dumps (DBpedia 2015-04, Freebase, Wikidata, LinkedGeoData, ...) with Virtuso 7.2.1 and Docker (optional) So you're the guy who is allowed to setup a local DBpedia mirror or more generally a local Linked Data mirror for your work group? OK,\u2026","rel":"","context":"In &quot;Coding&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/posts\/421"}],"collection":[{"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/comments?post=421"}],"version-history":[{"count":2,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/posts\/421\/revisions"}],"predecessor-version":[{"id":793,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/posts\/421\/revisions\/793"}],"wp:attachment":[{"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/media?parent=421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/categories?post=421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joernhees.de\/blog\/wp-json\/wp\/v2\/tags?post=421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}