I want to create a deployment server with nodejs application. I'll write nodejs code on my windows machine and push it on that ubuntu linux server. Can you tell how should I setup git for pushing a new code into this one?
Easiest way to setup git on server is to create empty bare git repository on server:
mkdir -p path/to/git/repos/myproject.git
cd path/to/git/repos/myproject.git
git init --bare
Now, go back to Windows box and setup msysgit git command line client or TortoiseGit to connect to your Linux box over ssh.
Your goal is to successfully clone your empty repo from the server:
git clone ssh://username@server:/path/to/git/repos/myproject.git
Once this is done, you can git add
your content to directory myproject
, then git commit
it and finally git push
.