Merge pull request #87 from mousavian/master
[git-ftp.git] / git-ftp.1
blob221a6a5c61ba41871d4635698c66978e263811cc
1 .TH GIT\-FTP 1 18/10/2011 HEAD "Git Manual"
2 .SH "NAME"
3 git-ftp \- Quick and efficient publishing of Git repositories over FTP
6 .SH "SYNOPSIS"
7 .sp
8 .nf
9 \fIgit ftp\fR [(\-\-force | \-f)] [(\-\-quiet | \-q)]
10         [(\-\-revision | \-r) <commit>] [(\-\-commit | \-c) <commit>]
11         [(\-\-branch | \-b) <branch>] [(\-\-section | \-s) <section>]
12 .fi
13 .sp
16 .SH "DESCRIPTION"
17 .sp
18 Some web hosts only give you FTP access to the hosting space, but you would
19 still like to use Git to version the contents of your directory. You could
20 upload a full tarball of your website every time you update, but that's
21 wasteful. \fIgit ftp\fR only uploads the files that changed.
24 .SH "OPTIONS"
26 .PP
27 \-f, \-\-force
28 .RS 4
29 Force the reupload of all files instead of just the changed ones\&.
30 .RE
32 .PP
33 \-q, \-\-quiet
34 .RS 4
35 Display only errors and warnings\&.
36 .RE
38 .PP
39 \-r <commit>, \-\-revision=<commit>
40 .RS 4
41 The SHA of the current revision is stored in \fIgit-rev.txt\fR on the server.
42 Use this revision instead of the server stored one, to determine which files
43 have changed\&.
44 .RE
46 .PP
47 \-c <commit>, \-\-commit=<commit>
48 .RS 4
49 Upload this commit instead of HEAD or the tip of the selected branch\&.
50 .RE
52 .PP
53 \-b <branch>, \-\-branch=<branch>
54 .RS 4
55 Use this branch instead of the active one\&.
56 .RE
58 .PP
59 \-s <section>, \-\-section=<section>
60 .RS 4
61 Use this section of the ftpdata file instead of the active branch name\&.
62 .RE
64 .SH "FTP CREDENTIALS"
65 .sp
66 You can place FTP credentials in \fI.git/ftpdata\fR, as such:
67 .sp
68 .if n \{\
69 .RS 4
70 .\}
71 .nf
72 [master]
73 username=me
74 password=s00perP4zzw0rd
75 hostname=ftp.hostname.com
76 remotepath=/htdocs
77 ssl=yes
79 [staging]
80 username=me
81 password=s00perP4zzw0rd
82 hostname=ftp.hostname.com
83 remotepath=/htdocs/staging
84 ssl=no
85 .fi
86 .if n \{\
87 .RE
88 .\}
89 .sp
90 Each section corresponds to a Git branch. If you don't create the configuration
91 file, \fIgit ftp\fR will interactively prompt you.
92 .sp
93 FTP SSL support needs Python 2.7 or later.
96 .SH "EXCLUDING FILES FROM UPLOADING"
97 .sp
98 Similarly to \fI.gitignore\fR you can exclude files from uploading.
99 .sp
100 The default file with ignore patterns is \fI.gitftpignore\fR in project root,
101 however you can specify your own for every branch in .git/ftpdata:
103 .if n\{\
104 .RS 4
107 [branch]
108  ... credentials ...
109 gitftpignore=.my_gitftpignore
111 .if n\{\
115 Used syntax is same as gitignore's with the exception of overriding patterns,
116 eg. "\fI!\fRsome/pattern", which is not supported.
117 Negations within patterns works as expected.
120 .SH "USING A BARE REPOSITORY AS A PROXY"
122 An additional script \fIpost-recieve\fR is provided to allow a central bare
123 repository to act as a proxy between the git users and the ftp server.
125 Pusing on branches that don't have an entry in the \fIftpdata\fR configuration file will have the default Git behaviour - nothing will be pushed over ftp.
127 One advantage is that users do not get to know the ftp credentials (perfect for
128 interns).
130 This is how the workflow looks like:
132 .if n \{\
133 .RS 4
136 User 1 --+                              +--> FTP Staging
137           \\                            /
138 User 2 -------> Bare Git repository -------> FTP Master
139           /                            \\
140 User 3 --+                              +--> FTP Dev
142 .if n \{\
146 This is how the setup looks like (one \fIftpdata\fR configuration file and a
147 symlink to the update hook):
149 .if n \{\
150 .RS 4
153 user@server:/path-to-repo/repo.git$ ls
154 HEAD  ORIG_HEAD  branches  config  description  ftpdata  hooks  info
156 user@server:/path-to-repo/repo.git/hooks$ ls -l
157 lrwxr-xr-x 1  user user  post-recieve -> /path-to-git-ftp/post-recieve
159 .if n \{\
164 .SH "LICENSE"
166 Copyright (c) 2008 - 2011
167 Edward Z. Yang <ezyang@mit.edu>, Mauro Lizaur <mauro@cacavoladora.org> and
168 Niklas Fiekas <niklas.fiekas@googlemail.com>
170 Permission is hereby granted, free of charge, to any person
171 obtaining a copy of this software and associated documentation
172 files (the "Software"), to deal in the Software without
173 restriction, including without limitation the rights to use,
174 copy, modify, merge, publish, distribute, sublicense, and/or sell
175 copies of the Software, and to permit persons to whom the
176 Software is furnished to do so, subject to the following
177 conditions:
179 The above copyright notice and this permission notice shall be
180 included in all copies or substantial portions of the Software.
182 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
183 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
184 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
185 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
186 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
187 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
188 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
189 OTHER DEALINGS IN THE SOFTWARE.
192 .SH "REPORTING BUGS"
193 Report bugs in the issue queue on Github
194 <https://github.com/ezyang/git-ftp/issues> or email one of the authors.
197 .SH "GIT"
199 Used as a part of the \fBgit\fR(1) suite.