Search code examples
gitgit-for-windows

Git for Windows remote rejected master -> master (unpacker error)


I'm having troubles a git repository to work with my team on our LAN network.

I'm getting this error when pushing to my bare repository.

The infrastructure that we have is all on Windows, and we can't change to linux.

I'm using git for windows and I managed to start a bare repository on server and then pull the repository from another two machines, make changes, commit them and push to the bare repository.

Everything fine at this point, but we wish to have a command to deploy our development.

I find I need a post-receive hook.

So I did and create the post-receive hook and look like this:

#!/bin/bash
git --work-tree=C:/Users/Admin/Desktop/fertitest
--git-dir=C:/Users/Admin/Desktop/fertitest.git checkout -f

I add the full control permission to the users that are allowed to make a push to the server on both directories the .git one and the working one where I want to deploy the code after a push command.

After that we can make a copy of our repository were we wanted to with

git clone //SERVER/fertitest.git

Add files and make commits with

git add *
git commit -a -m "first stage"

but when we try to push

git push origin master

We are getting the next error:

Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 263 bytes | 263.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
error: remote unpack failed: unable to create temporary object directory
To //CENTRAL/Users/Administrador/Desktop/fertipruebas.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 
'//SERVER/fertitest.git'

I'm stuck in this step, and I can't find where is the error, I tried to find this but everything I found were on Linux environment and was a permission errors or something else, not unpacker error.

Any idea of what can I try?


Solution

  • The “unable to create temporary directory” error means that for some reason, the remote machine cannot create the temporary object directory that is needed to quarantine objects during push. This usually means that permission to create one or more directories in that hierarchy failed.

    You should take a look at the permissions of the invoking user to make sure they have permission to create directories within the Git repository. How you would do that of course differs depending on whether the remote server is a Unix machine or a Windows machine.