git.pretty_commit() re-implemented with "git show" (bug #10018)
[stgit.git] / Documentation / stg-cp.txt
blob23149258cfb7791b5a79d57bc52ce5c670fae153
1 stg-cp(1)
2 =========
3 Yann Dirson <ydirson@altern.org>
4 v0.13, March 2007
6 NAME
7 ----
8 stg-cp - stgdesc:cp[]
10 SYNOPSIS
11 --------
12 [verse]
13 'stg' cp [OPTIONS] <file|dir> <newname>
14 'stg' cp [OPTIONS] <files|dirs...> <dir>
16 DESCRIPTION
17 -----------
19 Make git-controlled copies of git-controlled files.  The copies are
20 added to the Git index, so you can add them to a patch with
21 stglink:refresh[].
23 In the first form, copy a single file or a single directory, with a
24 new name.  The parent directory of <newname> must already exist;
25 <newname> itself must not already exist, or the command will be
26 interpreted as one of the second form.
28 In the second form, copy one or several files and/or directories, into
29 an existing directory.
31 Directories are copied recursively.  Only the git-controlled files
32 under the named directories are copied and added to the index.  Any
33 file not known to Git will not be copied.
35 CAVEATS
36 -------
38 This command does not allow yet to overwrite an existing file (whether
39 it could be recovered from Git or not).  Further more, when copying a
40 directory, the second form does not allow to proceed if a directory by
41 that name already exists inside the target, even when no file inside
42 that directory would be overwritten.
44 FUTURE OPTIONS
45 --------------
47 No options are supported yet.  The following options may be
48 implemented in the future.
50 --all::
51         Also copy files not known to Git when copying a directory.
53 --force::
54         Force overwriting of target files, even if overwritten files
55         have non-committed changes or are not known to Git.
57 --dry-run::
58         Show which files would be added, and which would be modified
59         if --force would be added.
61 StGIT
62 -----
63 Part of the StGIT suite - see gitlink:stg[1].