Skip to content

Instantly share code, notes, and snippets.

@iamdionysus
Last active December 31, 2015 16:49
Show Gist options
  • Save iamdionysus/8016384 to your computer and use it in GitHub Desktop.
Save iamdionysus/8016384 to your computer and use it in GitHub Desktop.
git set up
# generate public private key to avoid typing password every time
ssh-keygen -t rsa
scp ~/.ssh/id_rsa.pub user@address:id_rsa.tmp
ssh user@address
cat id_rsa.tmp >> .ssh/authorized_keys
exit
# local git initilization
cd /path/to/local/projectname
git init
git add .
# remote server git initilization
mkdir /path/to/remote/repository/projectname.git
cd /path/to/remote/repository/projectname.git
git init --bare
exit
# set local git to be connected to remote
# see it's ssh://user@address, not ssh:user@address. You need // or will get an error
cd /path/to/local/projectname
git remote add remote_name ssh://user@address/path/to/remote/repository/projectname.git
git push remote_name master
# make remote git available via http
cd /path/to/remote/repository/projectname.git
git --bare update-server-info
mv hooks/post-update.sample hooks/post-update
git update-server-info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment