git-publish
Publish local directories to remote servers with ease using git + ssh.
'\" t
.\" Title: git-publish
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
.\" Date: 2024-01-05
.\" Manual: Git-publish Manual
.\" Source: git-publish v0.0.1
.\" Language: English
.\"
.TH "GIT\-PUBLISH" "1" "2024-01-05" "git\-publish v0.0.1" "Git\-publish Manual"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE blue R < >
.\}
.SH "NAME"
git-publish \- Publish to remote directories using git + ssh.
.SH "SYNOPSIS"
.sp
\fBgit publish [init|worktree|hook] [\-r remote] [\-b branch] [\-m message]
[files|host:remote_path|remote_path] [local_path]\fP
.sp
\fBgit publish [\-r] [\-b] [\-m message] [files]\fP
.br
\fBgit publish init [\-r] [\-b] host:remote_path [local_path]\fP
.br
\fBgit publish worktree [\-r] [\-b] [\-d] remote_path\fP
.br
\fBgit publish hook host:remote_path\fP
.br
.SH "OPTIONS"
.sp
All commands accept some common configuration options in case you\(cqd like to
change the defaults. All dashed arguments should come \fIbefore\fP any positional
arguments and \fIafter\fP the subcommand.
.sp
\fB\-r remote\fP
.RS 4
The name of the remote to perform the publish operation on.
(Default \fIorigin\fP)
.RE
.sp
\fB\-b branch\fP
.RS 4
The name of the branch to perform the publish operation on.
(Default \fImain\fP or \fIinit.defaultBranch\fP if set)
.RE
.SH "COMMANDS"
.sp
When run with no arguments, it will publish all files in the repository to
\fI<remote>/<branch>\fP. Any worktrees that are on \fI<remote>\fP and are configured to
track \fI<branch>\fP will get updated.
.br
Note that all \fIremote_path\fP arguments \fBMUST\fP be absolute paths.
.sp
\fBpublish [<options>] [files]\fP
.RS 4
Publish \fIfiles\fP to \fI<remote>/<branch>\fP. Any worktrees that have been created on
\fIorigin\fP will be updated.
.sp
\fB\-m message\fP
.RS 4
Commit message to use. If no version is found in the message,
one will be appended to the end. (Default: Last commit if exists, else
"Publish Version")
.RE
.sp
\fBfiles\fP
.RS 4
List of files to publish. (Default: \fI\-A\fP All files)
.RE
.RE
.sp
\fBpublish init [<options>] host:remote_path [local_path]\fP
.RS 4
Initialize a repository on \fIhost\fP at \fIremote_path\fP and link it with
\fIlocal_path\fP.
.sp
\fBhost\fP
.RS 4
Remote host url. Accepts \fI[user@]host\fP and
\fIssh://[user@]host[:port]\fP formats.
.RE
.sp
\fBremote_path\fP
.RS 4
Absolute path of the bare git repository on \fIhost\fP.
e.g. \fI/git/something\-like.git\fP
.RE
.sp
\fBlocal_path\fP
.RS 4
Optional path to the local repository. (Default: Create a
directory with the remote repository\(cqs name e.g. \fI./something\-like/\fP)
.RE
.RE
.sp
\fBpublish worktree [<options>] remote_path\fP
.RS 4
Create a new worktree on \fI<remote>\fP at \fIremote_path\fP that gets updated on every
push to \fI<branch>\fP. If the \-d flag is specified, delete an existing worktree.
.sp
\fB\-d\fP
.RS 4
Delete an existing worktree instead of creating a new one.
.RE
.sp
\fBremote_path\fP
.RS 4
Absolute path of worktree on the remote.
.RE
.RE
.sp
\fBpublish hook host:remote_path\fP
.RS 4
Installs a post\-receive hook to \fIremote_path\fP on \fIhost\fP. This allows
publish worktrees to be created on an existing repository.
Note that this command can be run from anywhere.
.sp
\fBhost\fP
.RS 4
Remote host url. Accepts \fI[user@]host\fP and
\fIssh://[user@]host[:port]\fP formats.
.RE
.sp
\fBremote_path\fP
.RS 4
Absolute path of the bare git repository on \fIhost\fP.
e.g. \fI/git/something\-like.git\fP
.RE
.RE
.SH "EXIT STATUS"
.sp
\fB0\fP
.RS 4
Success.
.br
The program thinks everything was successful (you be the judge).
.RE
.sp
\fB1\fP
.RS 4
Error.
.br
An error occurred, probably an invalid argument or git operation.
.RE
.SH "RESOURCES"
.sp
Checkout the documentation for examples and more information about usages.
.sp
\fBDocumentation\fP
.RS 4
Documentation is available online: \c
.URL "https://rex.mckinnon.ninja/git\-publish" "" ""
.RE
.sp
\fBSource\fP
.RS 4
The source code is available on github: \c
.URL "https://github.com/Rex\-\-/git\-publish" "" ""
.RE
.sp
\fBManual\fP
.RS 4
This man page is available online: \c
.URL "https://rex.mckinnon.ninja/git\-publish#_git_publish1" "" ""
.RE
.SH "COPYING"
.sp
Copyright \(co 2022\-2024 Rex McKinnon
.br
This software is available for free under the permissive University of
Illinois/NCSA Open Source License. See the LICENSE file for full details.