Transfer a Git repository to a remote server

Initialize local git repository

cd projectdir
git init
git add .
git commit -m "Initial commit"

Prepare for transferring to server

git clone projectdir projectdir.git --bare
cd projectdir.git
git --bare update-server-info
mv hooks/post-update.sample hooks/post-update
chmod a+x hooks/post-update

Now transfer the projectdir.git to the server

Meta

Created:

Updated: 2015-12-15 23:12