I have an already working non-git directory (/var/www/site1) on my remote server, I make changes to it using ftp but I wanna use git. so here’s what I did:
cd ~/git/site1.git
git init --bare
cat > hooks/post-receive
#!/bin/sh
GIT_WORK_TREE=/var/www/site1 git checkout -f
$ chmod +x hooks/post-receive
How do I add files to the git repo so I could pull the files to my local directory? I tried:
git remote add ssh://root@remote:3756/git/site1.git site1
git pull site1 +master:refs/heads/master
fatal: Couldn't find remote ref master
I also tried:
git clone ssh://root@remote:3756/git/site1.git site1
Cloning into 'site1'...
warning: You appear to have cloned an empty repository.
I am following this tutorial: http://toroid.org/ams/git-website-howto
Download the files to your computer, clone the repository, copy files into repository folder, commit the files, and then push to the server. Don’t use git if you are going to use it to upload files to a website though, as the files aren’t directly visible.