Git hook post-receive does not checkout on Windows

Asked

Viewed 69 times

0

I’m using git to make a automatic deploy.

They are two computers with windows 7 on a local network. One of them would be a server and the other would be my development environment.

I created a BARE repository on my server and another repository on the server that will contain the php files that will be accessed by the user

I can push my development machine to BARE repository on the server.

On the server I checked that the BARE repository is being updated because I cloned it to another server folder and it is normal and updated

However after this same push the following is shown error

Counting objects: 3, done.
Writing objects: 100% (3/3), 281 bytes | 281.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: fatal: Invalid path 'C:/xampp': No such file or directory
To //nrspdt214406/var/repo/planejamento.tecnico.git
   dd1adcf..ea5b4c8  master -> master

And with that the files that are in BARE do not go to my repository that will be public access.

If I check out -f through git bash in the BARE repository the public repository is updated.

The post-receive is as follows:

#!/bin/sh
GIT_WORK_TREE='c:/xampp/htdocs/planejamento.tecnico' git checkout -f
  • He’s complaining that the folder doesn’t exist. You run over Mingw?

  • The folder does exist, I’m suspecting it might be some sort of escape character, but I can’t identify it. And about Mingw, excuse my ignorance, I can’t tell if it’s running on this or not.

  • Mingw is a tool to run Unix things on Windows. It’s been around for a long time. Today also has other alternatives, and more modern versions even comes with some bash built in (or with store download). I talked about Mingw because it doesn’t have c:/xampp, but yes /c/xampp. In that case, c:/xampp would be a reference to the folder c: within the repository Bare, and inside that folder there would still be the subfolder xampp. It may be that he is picking up relative reference, not absolute reference. It may be, but he would need to be sure, try

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.