Difference between pages "Portage Git Mirror" and "Template:ArticleFooter"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
=Setting up local git mirror =
{{#vardefine:Next|{{#show:{{FULLPAGENAME}}|?Next in Series|link=none}}}}
{{#if:{{#var:Next|}}|
=== Next >>> ===
'''Read the next article in this series: [[{{#var:Next}}]]'''


This tutorial explains how to save bandwidth when several local computers need to pull updates from a single remote git repository.
}}
 
{{Tip|[[Support Funtoo]] and help us grow! '''Donate $15 per month and get a free SSD-based [[Funtoo Hosting|Funtoo Virtual Container]].'''}}
== Use case ==
</div><div class="col-xs-12 col-md-3">{{#vardefine:Summary|{{#show:{{FULLPAGENAME}}|?Summary}}}}
 
{{#vardefine:Author|{{#show:{{FULLPAGENAME}}|?Author|link=none}}}}
This tutorial will be about hosting a local mirror of funtoo git based portage tree.
{{#vardefine:Icon|{{#show:{{FULLPAGENAME}}|?Icon}}}}
 
{{#if:{{#var:Author|}}|{{#widget:ArticleBio|body={{#show: {{#var:Author}} | ?Bio }}|user={{#var:Author|}}|icon_url={{#if:{{#var:Icon|}}|{{filepath:{{#sub:{{#var:Icon}}|5}}|80}}|http://www.gravatar.com/avatar/{{#show: {{FULLPAGENAME}} | ?Gravatar MD5}}/?s=80&d=retro&r=g}}}}}}
Following terms should be adapted
<div class="bs-head" style="text-decoration: underline; margin-bottom: 15px;">Got Funtoo?</div>
 
Have you installed Funtoo Linux yet? Discover the power of a from-source meta-distribution optimized for your hardware! See our [[Funtoo Linux Installation|installation instructions]] and [[Subarches|browse our CPU-optimized builds]].
<table border="1">
<div class="bs-head" style="text-decoration: underline; margin-bottom: 15px;">More Articles</div>
<tr class="header">
Browse all our Linux-related articles, below:
<th align="left">Terms</th>
{{#ask:[[Category:Articles]]
<th align="left">Definition</th>
|format=category
</tr>
|link=all
<tr class="odd">
|headers=show
<td align="left">git.lan</td>
|searchlabel=... further results
<td align="left">The git-daemon local mirror host</td>
|columns=1
</tr>
}}
<tr class="even">
__NOEDITSECTION__
<td align="left">localhost</td>
</div></div></div>
<td align="left">Any local host</td>
[[Category:Articles]]
</tr>
<tr class="odd">
<td align="left">nobody</td>
<td align="left">Owner user of .git files</td>
</tr>
<tr class="even">
<td align="left">/home/git-mirrors</td>
<td align="left">Base path of git-daemon</td>
</tr>
</table>
 
== Local mirror ==
 
=== Git-daemon configuration ===
 
Prepare directories and clone portage tree from github::
<console>
###i## mkdir /home/git-mirrors
###i## chown nobody /home/git-mirrors
###i## su -s /bin/sh nobody
$##bl## cd /home/git-mirrors
$##bl## git clone --mirror --bare git://github.com/funtoo/ports-2012.git portage.git
</console>
 
Configure git-daemon in <code>/etc/conf.d/git-daemon</code>:
 
<pre>
GITDAEMON_OPTS=&quot;--syslog --verbose --enable=receive-pack --export-all&quot;
GITDAEMON_OPTS=&quot;${GITDAEMON_OPTS} --base-path=/home/git-mirrors /home/git-mirrors&quot;
GIT_USER=&quot;nobody&quot;
GIT_GROUP=&quot;nobody&quot;
</pre>
 
Start the daemon:
<console>
###i## /etc/init.d/git-daemon start
###i## rc-update add git-daemon default
</console>
 
=== Pull from remote ===
 
Add the following to <code>/etc/cron.daily/funtoo-sync.sh</code>:
 
<pre>
#!/bin/sh
cd /home/git-mirrors/portage.git
su nobody -s "/bin/sh" -c "git fetch --all"
</pre>
 
== Cloning from local git-daemon ==
 
Local clone from <code>git.lan</code>:
<console>
###i## mv /usr/portage /usr/portage.old
###i## git clone git://git.lan/portage.git /usr/portage
###i## cd /usr/portage
###i## git checkout funtoo.org
</console>
 
[[Category:HOWTO]]

Revision as of 01:11, January 2, 2015

Next >>>

Read the next article in this series: [[{{#show:Template:ArticleFooter|?Next in Series|link=none}}]]

   Tip

Support Funtoo and help us grow! Donate $15 per month and get a free SSD-based Funtoo Virtual Container.


About the Author

{{#show: {{#show:Template:ArticleFooter|?Author|link=none}} | ?Bio }}

Got Funtoo?

Have you installed Funtoo Linux yet? Discover the power of a from-source meta-distribution optimized for your hardware! See our installation instructions and browse our CPU-optimized builds.

More Articles

Browse all our Linux-related articles, below: {{#ask: |format=category |link=all |headers=show |searchlabel=... further results |columns=1 }}