Table of Contents

Git for Portage

Gentoo provides a Github mirror of portage that can be used as an alternative to rsync. The primary resource for how to do this is Gentoo Wiki : Portage/Sync. It might seem daunting but its quite straight-forward.

Configure /etc/portage/repos.conf/gentoo.conf

Modify /etc/portage/repos.conf/gentoo.conf to have the following (note I was cautious and lazy and simply commented out the existing settings)…

[gentoo]
location = /usr/portage
# sync-type = rsync
# sync-uri = rsync://rsync.gentoo.org/gentoo-portage
sync-type = git
sync-uri = https://github.com/gentoo-mirror/gentoo.git
auto-sync = yes
priority = 1000

Now as root remove your existing portage tree and then sync it anew (optionally make a backup if you are concerned).

rm /usr/portage/distfiles/*
tar cjvf /tmp/portage.tar.bz2 /usr/portage/.
rm -rf /usr/portage/*
emerge --sync

Thats it you're updated.

Local Overlay

You might have your own local overlay in say /usr/local/portage/ and overlays from layman which will be referenced in /etc/portage/make.conf as…

# Overlays
PORTDIR_OVERLAY="/usr/portage/local"
source /var/lib/layman/make.conf

If you have your /usr/portage/local/ under Git version control (and if not why haven't you) then you can also configure portage to sync it from a backup on GitHub/GitLab

[My-Overlay]
location = /usr/local/portage
sync-type = git
sync-uri = git://gitlab.com/my/overlay.git
auto-sync = no