-
Notifications
You must be signed in to change notification settings - Fork 65
/
git-ftp.1
199 lines (174 loc) · 4.93 KB
/
git-ftp.1
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
.TH GIT\-FTP 1 18/10/2011 HEAD "Git Manual"
.SH "NAME"
git-ftp \- Quick and efficient publishing of Git repositories over FTP
.SH "SYNOPSIS"
.sp
.nf
\fIgit ftp\fR [(\-\-force | \-f)] [(\-\-quiet | \-q)]
[(\-\-revision | \-r) <commit>] [(\-\-commit | \-c) <commit>]
[(\-\-branch | \-b) <branch>] [(\-\-section | \-s) <section>]
.fi
.sp
.SH "DESCRIPTION"
.sp
Some web hosts only give you FTP access to the hosting space, but you would
still like to use Git to version the contents of your directory. You could
upload a full tarball of your website every time you update, but that's
wasteful. \fIgit ftp\fR only uploads the files that changed.
.SH "OPTIONS"
.PP
\-f, \-\-force
.RS 4
Force the reupload of all files instead of just the changed ones\&.
.RE
.PP
\-q, \-\-quiet
.RS 4
Display only errors and warnings\&.
.RE
.PP
\-r <commit>, \-\-revision=<commit>
.RS 4
The SHA of the current revision is stored in \fIgit-rev.txt\fR on the server.
Use this revision instead of the server stored one, to determine which files
have changed\&.
.RE
.PP
\-c <commit>, \-\-commit=<commit>
.RS 4
Upload this commit instead of HEAD or the tip of the selected branch\&.
.RE
.PP
\-b <branch>, \-\-branch=<branch>
.RS 4
Use this branch instead of the active one\&.
.RE
.PP
\-s <section>, \-\-section=<section>
.RS 4
Use this section of the ftpdata file instead of the active branch name\&.
.RE
.SH "FTP CREDENTIALS"
.sp
You can place FTP credentials in \fI.git/ftpdata\fR, as such:
.sp
.if n \{\
.RS 4
.\}
.nf
[master]
username=me
password=s00perP4zzw0rd
hostname=ftp.hostname.com
remotepath=/htdocs
ssl=yes
[staging]
username=me
password=s00perP4zzw0rd
hostname=ftp.hostname.com
remotepath=/htdocs/staging
ssl=no
.fi
.if n \{\
.RE
.\}
.sp
Each section corresponds to a Git branch. If you don't create the configuration
file, \fIgit ftp\fR will interactively prompt you.
.sp
FTP SSL support needs Python 2.7 or later.
.SH "EXCLUDING FILES FROM UPLOADING"
.sp
Similarly to \fI.gitignore\fR you can exclude files from uploading.
.sp
The default file with ignore patterns is \fI.gitftpignore\fR in project root,
however you can specify your own for every branch in .git/ftpdata:
.sp
.if n\{\
.RS 4
.\}
.nf
[branch]
... credentials ...
gitftpignore=.my_gitftpignore
.fi
.if n\{\
.RE
.\}
.sp
Used syntax is same as gitignore's with the exception of overriding patterns,
eg. "\fI!\fRsome/pattern", which is not supported.
Negations within patterns works as expected.
.SH "USING A BARE REPOSITORY AS A PROXY"
.sp
An additional script \fIpost-recieve\fR is provided to allow a central bare
repository to act as a proxy between the git users and the ftp server.
.sp
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.
.sp
One advantage is that users do not get to know the ftp credentials (perfect for
interns).
.sp
This is how the workflow looks like:
.sp
.if n \{\
.RS 4
.\}
.nf
User 1 --+ +--> FTP Staging
\\ /
User 2 -------> Bare Git repository -------> FTP Master
/ \\
User 3 --+ +--> FTP Dev
.fi
.if n \{\
.RE
.\}
.sp
This is how the setup looks like (one \fIftpdata\fR configuration file and a
symlink to the update hook):
.sp
.if n \{\
.RS 4
.\}
.nf
user@server:/path-to-repo/repo.git$ ls
HEAD ORIG_HEAD branches config description ftpdata hooks info
user@server:/path-to-repo/repo.git/hooks$ ls -l
lrwxr-xr-x 1 user user post-recieve -> /path-to-git-ftp/post-recieve
.fi
.if n \{\
.RE
.\}
.SH "LICENSE"
.sp
Copyright (c) 2008 - 2011
Edward Z. Yang <[email protected]>, Mauro Lizaur <[email protected]> and
Niklas Fiekas <[email protected]>
.sp
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
.sp
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
.sp
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
.SH "REPORTING BUGS"
Report bugs in the issue queue on Github
<https://github.com/ezyang/git-ftp/issues> or email one of the authors.
.SH "GIT"
.sp
Used as a part of the \fBgit\fR(1) suite.