I have been having trouble with this error message and I don't understand the proper solution to fix it or go about debugging it. I have googled the error in various forms but no real solution has presented itself. I am assuming it's an issue with permissions but I don't really know how to check or what I should check for.
I have a server running Ubuntu 11.10 and I'm basically trying to make the initial commit to my git repo from my development machine. I'm running as root. Should I be running as the user?
Repo creation on server:
$ cd /home/username/git
$ mkdir myrepo.git
$ cd myrepo.git/
$ git --bare init
Goto rails project directory first
$ git init
$ git add .
$ git commit -m "initial commit"
$ bundle pack
$ git add Gemfile.lock vendor/cache
$ git commit -m "bundle gems"
$ git remote add origin ssh://email@example.com/home/username/git/myrepo.git
$ git push origin master
fatal: Unable to create temporary file '/home/username/git/myrepo.git/./objects/pack/tmp_pack_XXXXXX': Permission denied
error: pack-objects died of signal 13
error: failed to push some refs to 'ssh://firstname.lastname@example.org/home/username/git/myrepo.git'
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
url = ssh://email@example.com/home/username/git/myrepo.git
fetch = +refs/heads/*:refs/remotes/origin/*
It sounds like you have file in the git repo owned by root. Since you're ssh'ing in as 'username' to do the push, the files must be writable by username. The easiest thing is probably to create the repo as the user, and use the same user to do your pushes. Another option is to create a group, make everything writable by the group, and make your user a member of that group.