Portage with Git

From Gentoo Wiki
Jump to:navigation Jump to:search

To use Git in Gentoo Portage do the following.

Have eselect-repository and Git installed.

Remove the old repository:

user $eselect repository remove gentoo

Set the sync-type:

root #eselect repository add gentoo git https://github.com/gentoo-mirror/gentoo.git
Resolving qa-reports.gentoo.org... 151.101.2.137, 151.101.66.137, 151.101.130.137, ...
Connecting to qa-reports.gentoo.org|151.101.2.137|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 260904 (255K) [text/xml]
Saving to: '/root/.cache/eselect-repo/repositories.xml'

repositories.xml                        100%[=============================================================================>] 254.79K  1.25MB/s    in 0.2s    

2022-08-20 09:17:36 (1.25 MB/s) - '/root/.cache/eselect-repo/repositories.xml' saved [260904/260904]

Adding gentoo to /etc/portage/repos.conf/eselect-repo.conf ...
Repository gentoo added

Verify the repos.conf content:

user $portageq repos_config /
[DEFAULT]
auto-sync = yes
main-repo = gentoo
strict-misc-digests = true
sync-allow-hardlinks = true
sync-openpgp-key-refresh = true
sync-rcu = false

[gentoo]
auto-sync = yes
location = /var/db/repos/gentoo
masters = 
priority = -1000
strict-misc-digests = true
sync-allow-hardlinks = true
sync-openpgp-key-path = /usr/share/openpgp-keys/gentoo-release.asc
sync-openpgp-key-refresh = true
sync-openpgp-key-refresh-retry-count = 40
sync-openpgp-key-refresh-retry-delay-exp-base = 2
sync-openpgp-key-refresh-retry-delay-max = 60
sync-openpgp-key-refresh-retry-delay-mult = 4
sync-openpgp-key-refresh-retry-overall-timeout = 1200
sync-openpgp-keyserver = hkps://keys.gentoo.org
sync-rcu = false
sync-type = git
sync-uri = https://github.com/gentoo-mirror/gentoo.git

Delete the old Portage tree:

root #rm -r /var/db/repos/gentoo

Redo it with Git:

root #emaint sync -r gentoo

Run again to test.