getting “fatal: not a git repository: '.'” when using post-update hook to execute 'git pull' on another repo

前端 未结 5 558
梦谈多话
梦谈多话 2020-11-30 20:17

I\'m new to git so I apologize (and please correct me) if I misuse terminology here, but I\'ll do my best.

I\'m trying to set up a bare git repo (hub) and a developm

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-30 20:57

    Here is the script that ultimately worked. I think the bit I was originally missing that prevented it from working remotely was the unset GIT_DIR

    #!/bin/sh
    cd /path/to/working-copy/ || exit
    unset GIT_DIR
    git pull repo branch
    
    exec git-update-server-info
    

提交回复
热议问题