Changes between Initial Version and Version 1 of howto/SyncingWithGit


Ignore:
Timestamp:
Oct 29, 2016, 7:39:05 PM (8 years ago)
Author:
raimue (Rainer Müller)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/SyncingWithGit

    v1 v1  
     1[wiki:howto <- Back to the HOWTO section]
     2
     3= How to sync your ports tree using Git over HTTPS =
     4
     5- Audience: end users who cannot use rsync (873/tcp) due to firewalls, proxies, policy, etc.
     6- Requires: MacPorts
     7- Requires: Git
     8
     9
     10== Introduction ==
     11
     12Some people live and work behind a firewall or proxy that blocks or otherwise breaks rsync, which is the primary means of getting updated Portfiles in MacPorts. The following steps will switch your tree over to using Git over HTTPS for syncing.
     13
     14Note: if you are using a custom prefix, you will have to replace the default of `/opt/local` with the location of your MacPorts install in the instructions below.
     15
     16
     17== Installation ==
     18
     19=== Step 0: Install Git ===
     20
     21Git already comes pre-installed with Xcode. Most users will not need to install it manually. If you are unsure whether you already have it installed, check with this command:
     22
     23{{{
     24git --version
     25}}}
     26
     27Unless you see an error message with `command not found`, you already have git and can skip this step.
     28
     29Continue only if you do not already have `git` installed.
     30If you have a copy of the ports tree already, just run:
     31{{{
     32sudo port install git
     33}}}
     34If you do not have a copy of the ports tree, you can download the daily
     35tarball by following [wiki:howto/PortTreeTarball the tarball howto].
     36
     37=== Step 1: Checkout Initial Copy ===
     38
     39{{{
     40cd /opt/local/var/macports/sources
     41sudo mkdir -p github.com/macports/macports-ports/
     42sudo chown -R $USER:admin github.com
     43git clone https://github.com/macports/macports-ports.git github.com/macports/macports-ports/
     44}}}
     45
     46== Configuration ==
     47
     48=== Step 2: Configure MacPorts ===
     49
     50Edit `/opt/local/etc/macports/sources.conf` to comment out the `rsync://` entry and add a new `file:///` entry:
     51
     52Note: if you need to replace `/opt/local` with your custom prefix, make sure the initial "!file:///..." contains three slashes.
     53
     54{{{
     55#rsync://rsync.macports.org/release/ports/ [default]
     56file:///opt/local/var/macports/sources/github.com/macports/macports-ports/ [default]
     57}}}
     58
     59=== Step 3: Sync ===
     60
     61On running your first sync you will have wait for the PortIndex to be generated, which will take some time. Subsequent runs will be faster, as only changed Portfiles need to be indexed again. Use the `-v` flag for verbose mode which will show you the progress of this operation.
     62
     63{{{
     64sudo port -v sync
     65}}}
     66
     67After this has finished, you are now receiving your Portfiles from Git instead of rsync.
     68
     69== See also ==
     70
     71Additional topics related to MacPorts and Git:
     72
     73- Creating and testing ports not yet submitted to MacPorts:
     74  [https://guide.macports.org/#development.local-repositories Local development repository]
     75- [wiki:RunningTrunk Running an unstable/development version of MacPorts]
     76
     77[wiki:howto <- Back to the HOWTO section]