mirror of
https://github.com/NixOS/nix
synced 2025-07-09 03:43:54 +02:00
Merge pull request #2582 from LnL7/fetchgit-refs
fetchGit: allow fetching explicit refs
This commit is contained in:
commit
33db1d35ae
4 changed files with 43 additions and 1 deletions
|
@ -425,6 +425,13 @@ stdenv.mkDerivation { … }
|
|||
This is often a branch or tag name. Defaults to
|
||||
<literal>HEAD</literal>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
By default, the <varname>ref</varname> value is prefixed
|
||||
with <literal>refs/heads/</literal>. As of Nix 2.3.0
|
||||
Nix will not prefix <literal>refs/heads/</literal> if
|
||||
<varname>ref</varname> starts with <literal>refs/</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
@ -438,6 +445,14 @@ stdenv.mkDerivation { … }
|
|||
}</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Fetching an arbitrary ref</title>
|
||||
<programlisting>builtins.fetchGit {
|
||||
url = "https://gitub.com/NixOS/nix.git";
|
||||
ref = "refs/heads/0.5-release";
|
||||
}</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Fetching a repository's specific commit on an arbitrary branch</title>
|
||||
<para>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue