Autogenerated man pages for v1.4.0-rc1-gfd7e
[git.git] / man1 / git-p4import.1
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .de Sh \" Subsection
3 .br
4 .if t .Sp
5 .ne 5
6 .PP
7 \fB\\$1\fR
8 .PP
9 ..
10 .de Sp \" Vertical space (when we can't use .PP)
11 .if t .sp .5v
12 .if n .sp
13 ..
14 .de Ip \" List item
15 .br
16 .ie \\n(.$>=3 .ne \\$3
17 .el .ne 3
18 .IP "\\$1" \\$2
19 ..
20 .TH "GIT-P4IMPORT" 1 "" "" ""
21 .SH NAME
22 git-p4import \- Import a Perforce repository into git
23 .SH "SYNOPSIS"
24
25
26 git\-p4import [\-q|\-v] [\-\-authors <file>] [\-t <timezone>] <//p4repo/path> <branch>
27
28
29 git\-p4import \-\-stitch <//p4repo/path>
30
31
32 git\-p4import
33
34 .SH "DESCRIPTION"
35
36
37 Import a Perforce repository into an existing git repository\&. When a <//p4repo/path> and <branch> are specified a new branch with the given name will be created and the initial import will begin\&.
38
39
40 Once the initial import is complete you can do an incremental import of new commits from the Perforce repository\&. You do this by checking out the appropriate git branch and then running git\-p4import without any options\&.
41
42
43 The standard p4 client is used to communicate with the Perforce repository; it must be configured correctly in order for git\-p4import to operate (see below)\&.
44
45 .SH "OPTIONS"
46
47 .TP
48 \-q
49 Do not display any progress information\&.
50
51 .TP
52 \-v
53 Give extra progress information\&.
54
55 .TP
56 \-\-authors
57 Specify an authors file containing a mapping of Perforce user ids to full names and email addresses (see Notes below)\&.
58
59 .TP
60 \-\-stitch
61 Import the contents of the given perforce branch into the currently checked out git branch\&.
62
63 .TP
64 \-\-log
65 Store debugging information in the specified file\&.
66
67 .TP
68 \-t
69 Specify that the remote repository is in the specified timezone\&. Timezone must be in the format "US/Pacific" or "Europe/London" etc\&. You only need to specify this once, it will be saved in the git config file for the repository\&.
70
71 .TP
72 <//p4repo/path>
73 The Perforce path that will be imported into the specified branch\&.
74
75 .TP
76 <branch>
77 The new branch that will be created to hold the Perforce imports\&.
78
79 .SH "P4 CLIENT"
80
81
82 You must make the p4 client command available in your $PATH and configure it to communicate with the target Perforce repository\&. Typically this means you must set the "$P4PORT" and "$P4CLIENT" environment variables\&.
83
84
85 You must also configure a p4 client "view" which maps the Perforce branch into the top level of your git repository, for example:
86
87 .nf
88 Client: myhost
89
90 Root:   /home/sean/import
91
92 Options:   noallwrite clobber nocompress unlocked modtime rmdir
93
94 View:
95         //public/jam/\&.\&.\&. //myhost/jam/\&.\&.\&.
96 .fi
97
98
99 With the above p4 client setup, you could import the "jam" perforce branch into a branch named "jammy", like so:
100
101 .nf
102 $ mkdir \-p /home/sean/import/jam
103 $ cd /home/sean/import/jam
104 $ git init\-db
105 $ git p4import //public/jam jammy
106 .fi
107
108 .SH "MULTIPLE BRANCHES"
109
110
111 Note that by creating multiple "views" you can use git\-p4import to import additional branches into the same git repository\&. However, the p4 client has a limitation in that it silently ignores all but the last "view" that maps into the same local directory\&. So the following will \fInot\fR work:
112
113 .nf
114 View:
115         //public/jam/\&.\&.\&. //myhost/jam/\&.\&.\&.
116         //public/other/\&.\&.\&. //myhost/jam/\&.\&.\&.
117         //public/guest/\&.\&.\&. //myhost/jam/\&.\&.\&.
118 .fi
119
120
121 If you want more than one Perforce branch to be imported into the same directory you must employ a workaround\&. A simple option is to adjust your p4 client before each import to only include a single view\&.
122
123
124 Another option is to create multiple symlinks locally which all point to the same directory in your git repository and then use one per "view" instead of listing the actual directory\&.
125
126 .SH "TAGS"
127
128
129 A git tag of the form p4/xx is created for every change imported from the Perforce repository where xx is the Perforce changeset number\&. Therefore after the import you can use git to access any commit by its Perforce number, eg\&. git show p4/327\&.
130
131
132 The tag associated with the HEAD commit is also how git\-p4import determines if there are new changes to incrementally import from the Perforce repository\&.
133
134
135 If you import from a repository with many thousands of changes you will have an equal number of p4/xxxx git tags\&. Git tags can be expensive in terms of disk space and repository operations\&. If you don't need to perform further incremental imports, you may delete the tags\&.
136
137 .SH "NOTES"
138
139
140 You can interrupt the import (eg\&. ctrl\-c) at any time and restart it without worry\&.
141
142
143 Author information is automatically determined by querying the Perforce "users" table using the id associated with each change\&. However, if you want to manually supply these mappings you can do so with the "\-\-authors" option\&. It accepts a file containing a list of mappings with each line containing one mapping in the format:
144
145 .nf
146     perforce_id = Full Name <email@address\&.com>
147 .fi
148
149 .SH "AUTHOR"
150
151
152 Written by Sean Estabrooks <seanlkml@sympatico\&.ca>
153
154 .SH "GIT"
155
156
157 Part of the \fBgit\fR(7) suite
158