Skip to content

Instantly share code, notes, and snippets.

@vishalbasnet23
Created November 14, 2014 11:05
Show Gist options
  • Select an option

  • Save vishalbasnet23/2fff0b2a4b59e24ba1a8 to your computer and use it in GitHub Desktop.

Select an option

Save vishalbasnet23/2fff0b2a4b59e24ba1a8 to your computer and use it in GitHub Desktop.
Setting up git repo in remote server
git remote add server ssh://user@server.com:p/home/user/repo.git/
git push server master
mkdir repo.git
cd repo.git
git init --bare
git --bare update-server-info
git config core.bare false
git config receive.denycurrentbranch ignore
git config core.worktree /home/user/public_html/app
cat > hooks/post-receive <<EOF
#!/bin/sh
git checkout -f
EOF
chmod +x hooks/post-receive
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment