ubuntu 16.04 - Why can't git post-receive hook find single file in repo? -


i have git post-receive hook

#!/bin/sh git --work-tree=/var/www/myproject --git-dir=/home/git/myrepo.git checkout -f -- api.py 

and local repo contains .git folder , api.py file.

when push project following error:

$ git push counting objects: 3, done. delta compression using 4 threads. compressing objects: 100% (2/2), done. writing objects: 100% (3/3), 272 bytes | 0 bytes/s, done. total 3 (delta 1), reused 0 (delta 0) remote: error: pathspec 'myrepo/api.py' did not match file(s) known git. 

i have tried adding full file path myrepo/api.py git hook , gave same error path.

what correct way reference file i'm trying move? remote computer ubuntu 16.04.

thanks!

replace checkout git status see if on right branch.

try specify branch:

 git --work-tree=/var/www/myproject --git-dir=/home/git/myrepo.git checkout master -f -- api.py 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -