Lightweight command-line utility for managing private repositories on a server.
- Darwin (MacOSX)
- Linux
- Linux Server
- i.e. $5/mo Digital Ocean node (I'm not affiliated with DO)
Grab the latest release for your platform, and place the pgit
executable
in a folder available in your $PATH
. Next, add the PGIT_URL
environment
variable to your $HOME/.bashrc
or similar file.
export PGIT_URL=<user>@<host>[:port]
SSH into your server as root (or as a user with sudo privileges).
Install git on the server.
Create a git
user:
sudo adduser \
--home /home/git \
--shell /bin/bash \
--disabled-password \
git
Prepare the authorized_keys
file:
sudo mkdir /home/git/.ssh
sudo touch /home/git/.ssh/authorized_keys
sudo chmod 700 /home/git/.ssh
sudo chmod 600 /home/git/.ssh/authorized_keys
sudo chown -R git:git /home/git/.ssh
Now store your $HOME/.ssh/id_rsa.pub
in /home/git/.ssh/authorized_keys
.
Run pgit help
to view the help screen:
Lightweight command-line utility for managing private repositories on a server.
Usage:
pgit command [arguments]
Commands:
list list all repositories
clip clip the url of a repository to your clipboard
create <name> create a new repository
rename <name> <new_name> rename an existing repository
destroy <name> destroy an existing repository
version display the current pgit version
help display this help screen
https://github.com/mrrooijen/pgit
Checkout this guide that uses Backup to perform periodic backup operations against your repositories.
Released under the MIT License by Michael van Rooijen.