Git repositories
Creating a Repo
creating a repository (to be synchronized to/from)
cd /path/projectname git init --barecreate a project (to work in, push/pull from repo)
cd /path/projectname git init
Git Transfer Protocols
Git can communicate using a variety of protocols. Personally, I like using ssh best since it is secure, universal, and I'm already using it.
ssh
First, create a git repo on a server that is accessible using ssh. See openssh . Next, add a git remote to your project referring to it using the ssh protocol.
git remote add origin ssh://git@gitbox:8610/home/git/my_project git --set-upstream origin --all git pushTechnically, this is all you need. It would be prudent to create a
git
user with minimal privileges, and configured to usegit-shell
(which allows pull/push only).Special Cases
Verify
git fsck ## check that repo is not corruptLarge Files
The git repo also reads
~/.gitconfig
, and if you are experiencing issues cloning large files, it can be helpful to perform the following on the server, and if that does not help, on the client as well.#### ~/.gitconfig [pack] windowMemory = 1000m SizeLimit = 1000m threads = 1 window = 0