Set up Bare git repo on server Create a folder to keep our code(work tree of git) mkdir /home/user/app/ Create a folder for git (eg. repo.git) and cd mkdir repo.git cd repo.git Initialize bare repo and configure worktree git init --bare git --bare update-server-info git config core.bare false git config receive.denycurrentbranch ignore git config core.worktree /home/user/app/ Write hooks to update worktree on receiving commits cat > hooks/post-receive <<EOF #!/bin/sh git checkout -f EOF chmod +x hooks/post-receive