GIT remote repo creation

In this example, I used Hostmonster but any host will most likely work the same.

ssh your-remote-server
mkdir mysitegit
cd mysitegit
git init --bare --shared

While still logged in to the remote server, use nano (or vim etc.) to edit the git config file:

nano config

Add the following lines to the bottom and save the file:

[pack]
	windowMemory = 100m
	SizeLimit = 100m
	threads = 1
	window = 0

Exit the remote terminal:

exit
You should now be logged in to your local computer, not the remote.
cd ~/public_html/mysite
git remote add hostmonster ssh://your-remote-server/~/mysitegit
nano .git/config
Now, add the hostmonster remote section in the local .git/config file:
[remote "hostmonster"]
	url = ssh://your-remote-server/~/mysitegit
	fetch = +refs/heads/*:refs/remotes/hostmonster/*
Return to the terminal
git push hostmonster master
# after the first push, use just  git push hostmonster

Internal References

Article Type

General