Created
November 14, 2014 11:05
-
-
Save vishalbasnet23/2fff0b2a4b59e24ba1a8 to your computer and use it in GitHub Desktop.
Setting up git repo in remote server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git remote add server ssh://user@server.com:p/home/user/repo.git/ | |
| git push server master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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