I was previously using GIT with unfuddle, however I'm looking at trying Gitflow with Github as the central repository. So far I have done the following so far:
cd /home/username/Downloads/
(on local machine)wget -q –
http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh
–no-check-certificate
sudo chmod a+x gitflow-installer.sh
sudo chmod a+x gitflow-installer.sh
cd /var/www/website/
(where the website files are)git flow init
git remote add origin git@github.com:username/website.git
git add *
git commit -am “initial commit”
All files are now committed ready to push to the central repository.
Create SSH key using this tutorial - https://help.github.com/articles/generating-ssh-keys
Now, I'm trying to push the files to the central respository, however although the files have been pushed I got the following errors:
error: unable to create directory for .git/refs/remotes/origin/develop
error: Cannot lock the ref 'refs/remotes/origin/develop'.
Any idea why? Is this the correct setup so far?
"unable to create directory for .git/refs/remotes/origin/develop" means there is a permission issue to write the remote reference in your local repo initialized in /var/www/website/
.
In this question for instance, the OP had to do a sudo git push
.
sudo
or chown
are mentioned in "Problems with first upload to github".
On the remote side, as mentioned in "uploading a repository to github fails says “permission denied”", make sure to add your public ssh key to your GitHub repo.