post-receive hook can't change folder content on my ubuntu server after exec hexo deploy #2095

Closed
opened 2025-11-02 04:23:59 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @AaronWing on GitHub (Jul 25, 2018).

hook content:

#!/usr/bin/env bash
while read oldrev newrev refname
do
    branch=$(git rev-parse --symbolic --abbrev-ref $refname)
    if [ "master" == "$branch" ]; then
        # Do something
        git --work-tree=/data/extend_01/hexo --git-dir=/data/extend_01/gitea/data/git/repositories/aaronwing/blog-hexo.git checkout -f
    fi
done

it can be triggered after exec "hexo deploy",but specific folder not any change

Originally created by @AaronWing on GitHub (Jul 25, 2018). hook content: ```bash #!/usr/bin/env bash while read oldrev newrev refname do branch=$(git rev-parse --symbolic --abbrev-ref $refname) if [ "master" == "$branch" ]; then # Do something git --work-tree=/data/extend_01/hexo --git-dir=/data/extend_01/gitea/data/git/repositories/aaronwing/blog-hexo.git checkout -f fi done ``` it can be triggered after exec "hexo deploy",but specific folder not any change
GiteaMirror added the issue/stale label 2025-11-02 04:23:59 -06:00
Author
Owner

@SagePtr commented on GitHub (Jul 27, 2018):

Does this command work if run manually by the same user as gitea is run under (not root) ?

git --work-tree=/data/extend_01/hexo --git-dir=/data/extend_01/gitea/data/git/repositories/aaronwing/blog-hexo.git checkout -f
@SagePtr commented on GitHub (Jul 27, 2018): Does this command work if run manually by the same user as gitea is run under (not root) ? ``` git --work-tree=/data/extend_01/hexo --git-dir=/data/extend_01/gitea/data/git/repositories/aaronwing/blog-hexo.git checkout -f ```
Author
Owner

@stale[bot] commented on GitHub (Jan 16, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jan 16, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@lunny commented on GitHub (Jan 16, 2019):

Closed since no feedback so long. Feel free to reopen it.

@lunny commented on GitHub (Jan 16, 2019): Closed since no feedback so long. Feel free to reopen it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2095