File: gbp-clone.xml

package info (click to toggle)
git-buildpackage 0.9.39
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,464 kB
  • sloc: python: 18,427; xml: 8,746; sh: 731; makefile: 139
file content (267 lines) | stat: -rw-r--r-- 9,767 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<refentry id="man.gbp.clone">
  <refentryinfo>
    <address>
      &dhemail;
    </address>
    <author>
      &dhfirstname;
      &dhsurname;
    </author>
  </refentryinfo>
  <refmeta>
   <refentrytitle>gbp-clone</refentrytitle>
    &dhsection;
  </refmeta>
  <refnamediv>
    <refname>gbp-clone</refname>
    <refpurpose>Clone a &git; repository from a remote and set up the necessary branch tracking</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      &gbp-clone;

      &man.common.options.synopsis;
      <arg><option>--all</option></arg>
      <arg><option>--[no-]pristine-tar</option></arg>
      <arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
      <arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
      <arg><option>--depth=</option><replaceable>depth</replaceable></arg>
      <arg><option>--reference=</option><replaceable>repository</replaceable></arg>
      <arg><option>--postclone=</option><replaceable>COMMAND</replaceable></arg>
      <arg><option>--[no-]hooks</option></arg>
      <arg><option>--defuse-gitattributes=</option><replaceable>[auto|on|off]</replaceable></arg>
      <arg><option>--repo-user=</option><option>[GIT|DEBIAN]</option></arg>
      <arg><option>--repo-email=</option><option>[GIT|DEBIAN]</option></arg>
      <arg><option>--[no-]aliases</option></arg>
      <arg><option>--[no-]add-upstream-vcs</option></arg>
      <arg choice="plain"><replaceable>repository</replaceable></arg>
      <arg><replaceable>directory</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>
    <para>
      Unlike a regular <command>git clone</command>, the &gbp-clone; will parse
      the <emphasis>debian/gbp.conf</emphasis> options and clone the remote
      repository with correct branches tracked.
    </para>
    <para>
      Likewise, it is recommended to use &gbp-pull; and &gbp-push; to later
      update the repository as it will spare from having to run
      <command>git pull</command> and <command>git push</command> multiple times
      or with lengthy arguments to sync each tracked branch.
    </para>
  </refsect1>
  <refsect1>
    <title>OPTIONS</title>

    <variablelist>
      &man.common.options.description;

      <varlistentry>
        <term><option>--all</option>
        </term>
        <listitem>
	  <para>Track all branches, not only <replaceable>debian</replaceable>
	  and <replaceable>upstream</replaceable>.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--debian-branch</option>=<replaceable>branch_name</replaceable>
        </term>
        <listitem>
	  <para>The branch in the Git repository the Debian package is being
	  developed on, default is <replaceable>master</replaceable>.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
        </term>
        <listitem>
	  <para>The branch in the &git; repository the upstream sources are put
	  onto. Default is <replaceable>upstream</replaceable>.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--depth</option>=<replaceable>depth</replaceable>
        </term>
        <listitem>
          <para>Git history depth, for creating shallow git clones.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--reference</option>=<replaceable>repository</replaceable>
        </term>
        <listitem>
          <para>Local repository to use as alternate instead of re-copying data from remote repository.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--pristine-tar</option>
        </term>
        <listitem>
          <para>Track pristine tar branch.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--[no-]hooks</option></term>
	<listitem>
          <para>
            Enable running hooks.
          </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--postclone=</option><replaceable>COMMAND</replaceable></term>
	<listitem>
          <para>
            Execute <replaceable>COMMAND</replaceable> after cloning the source
            from the remote.
          </para>
          <para>
            Exported environment variables are: <envar>GBP_GIT_DIR</envar> (the
            repository the package is being built from).
          </para>
	  <para>Note that if you clone a repository that contains a
	    hook configuration in <filename>debian/gbp.conf</filename>
	    this hook will not be run automatically to prevent execution
	    of untrusted code.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--defuse-gitattributes=</option><option>[auto|on|off]</option></term>
	<listitem>
          <para>
            Disable Git attributes that may interfere with building packages. Works
            by updating <filename>.git/info/attributes</filename> to override attributes
            in the upstream sources which may cause files to be transformed on checkout.
            More specifically, a new macro attribute is defined, <symbol>[attr]dgit-defuse-attrs</symbol>,
            which is then applied to <filename>*</filename> together with <symbol>export-subst</symbol>
            and <symbol>export-ignore</symbol>. This is done to be compatible with <command>dgit</command>
            and <command>git-deborig</command> which disable Git attributes this way.
          </para>
          <para>
            If set to <replaceable>auto</replaceable>, first check whether there
            are any <filename>.gitattributes</filename> files in the upstream source,
            and act only if there are some. If set to <replaceable>on</replaceable>,
            unconditionally there are some. If set to <replaceable>off</replaceable>,
            does nothing.
          </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--repo-email=</option><option>[GIT|DEBIAN]</option></term>
        <listitem>
          <para>
	    When set to <option>DEBIAN</option>
	    use the <envar>DEBEMAIL</envar> environment variable to set the
	    user.email &git; configuration otherwise use &git;'s
	    defaults.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><option>--repo-user=</option><option>[GIT|DEBIAN]</option></term>
        <listitem>
          <para>
	    When set to <option>DEBIAN</option>
	    use the <envar>DEBFULLNAME</envar> environment variable to set the
	    user.name &git; configuration otherwise use &git;'s
	    defaults.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--[no-]aliases</option>
        </term>
        <listitem>
          <para>
	    Whether to expand gbp specific aliases for remote repos like <symbol>salsa:</symbol>.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--[no-]add-upstream-vcs</option>
        </term>
        <listitem>
          <para>
	    Whether to add the upstream git repository as additional remote. The repository url is read from
	    the "Repository" field in
            <filename>debian/upstream/metadata</filename>.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
	<term><replaceable>repository</replaceable></term>
	<listitem>
          <para>
	    The (possibly remote) repository to clone from. This is
	    usually a &git; URL but some shortcuts are supported (see below).
          </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><replaceable>directory</replaceable></term>
	<listitem>
          <para>
	    The directory to clone to.
          </para>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1>
    <title>EXAMPLES</title>
    <para>
      Clone the Debian packaging repository and the upstream repository in one go:
    </para>
    <screen>&gbp-clone; -add-upstream-vcs vcs-git:entr</screen>
    <para>
      The branches, tags and pristine-tar will be automatically setup correctly
      following the contents of debian/gbp.conf in the package, and there will
      be an additional git remote with the name <emphasis>upstreamvcs</emphasis>
      that points to the upstream Entr repository on GitHub.
    </para>
    <para>
      A parameter on the command line would override anything in the
      debian/gbp.conf file. For example, clone a repository and setup a tracking
      branch for pristine-tar as well:
    </para>
    <screen>&gbp-clone; --pristine-tar git://honk.sigxcpu.org/git/git-buildpackage.git</screen>
    <para>
      Clone from the <emphasis>Git-Vcs</emphasis> URL of a package:
    </para>
    <screen>&gbp-clone; vcs-git:libvirt</screen>
    <para>
      Clone a repository from Salsa (Debian's code hosting):
    </para>
    <screen>&gbp-clone; salsa:agx/git-buildpackage</screen>
    <para>
      Clone from a GitHub repository:
    </para>
    <screen>&gbp-clone; github:agx/git-buildpackage</screen>
  </refsect1>
  <refsect1>
      &man.gbp.config-files;
  </refsect1>
  <refsect1>
    <title>SEE ALSO</title>
    <para>
      <xref linkend="man.gbp.buildpackage"/>,
      <xref linkend="man.gbp.pull"/>,
      <xref linkend="man.gbp.setup.gitattributes"/>,
      <xref linkend="man.gbp.conf"/>,
      <citerefentry>
        <refentrytitle>gitattributes</refentrytitle>
        <manvolnum>5</manvolnum>
      </citerefentry>
    </para>
  </refsect1>
  <refsect1>
    <title>AUTHOR</title>

    <para>&dhusername; &dhemail;</para>

  </refsect1>
</refentry>