Changes between Version 7 and Version 8 of WorkingConventions/Git/Submodules


Ignore:
Timestamp:
May 29, 2014 10:04:58 AM (15 months ago)
Author:
hvr
Comment:

add notes about Git Repo url rewriting

Legend:

Unmodified
Added
Removed
Modified
  • WorkingConventions/Git/Submodules

    v7 v8  
    4242}}}
    4343
    44 === Overriding `remote.origin.pushurl` ===
     44=== Using the !GitHub GHC Mirror ===
     45
     46You can instruct `git` to rewrite repo URLs via the `git config url.<base>.insteadOf` facility. For instance, the following configuration (which gets written to `${HOME}/.gitconfig`, so this needs to be done only once) uses GitHub instead of `git.haskell.org` for synchronizing/cloning the GHC repos:
     47
     48{{{#!sh
     49git config --global url."git://github.com/ghc/".insteadOf git://git.haskell.org/
     50git config --global url."git://github.com/ghc/packages-".insteadOf git://git.haskell.org/packages/
     51}}}
     52
     53(If needed, you can also add rewrite rules with `git://` substituted by `https://` or other schemes)
     54
     55=== Asymmetric push/pull Git Repo URLS ===
     56
     57==== Using `git config url.<base>.insteadOf` ====
     58
     59This subsection is mostly relevant to developers with `git push`-permissions.
     60
     61In addition to the `git config url.<base>.insteadOf` facility described in the previous section, there's also a `pushInsteadOf` facility which allows to rewrite only `push` operations and takes precedence over a respective `insteadOf` match. This can be used to use the faster (non-authenaticated) `http(s)://` or `git://` based transports for read-operations, and only use the more heavyweight authenticated `ssh://` transport for actual `git push` operations. Such an asymmetric push/pull setting can be configured **globally** like so:
     62
     63{{{#!sh
     64git config --global url."ssh://[email protected]/".pushInsteadOf git://git.haskell.org/
     65
     66# If you want to cover all bases, you can also set the following rewrite rules
     67git config --global url."ssh://[email protected]/".pushInsteadOf http://git.haskell.org/
     68git config --global url."ssh://[email protected]/".pushInsteadOf https://git.haskell.org/
     69}}}
     70
     71==== By overriding `remote.origin.pushurl` ====
     72
     73{{{#!box note
     74It's recommended to use the scheme based on the `git config url.<base>.pushInsteadOf` facility described in the previous subsection instead of the one described in this subsection.
     75}}}
    4576
    4677This subsection is only relevant for developers with `git push`-permissions.
     
    6394  'git config remote.origin.pushurl || git config remote.origin.url'
    6495}}}
     96
    6597== Updating an existing GHC source tree clone ==
    6698