git-post-receive

PATH in post-receive hook doesn't contain PATH as set in bashrc

匆匆过客 提交于 2021-01-28 14:08:51
问题 How can I set the PATH on Ubuntu in a way where its variables that I set are also set in a post-receive script? Currently I'm doing it via the ~/.bashrc file like this: export PATH="$PATH:/opt/mssql-tools/bin" but can't see any change in the PATH if I print it from the hook. Therefore, if I try to execute the command in question in the hook, I get remote: FileNotFoundError: [Errno 2] No such file or directory: 'sqlcmd': 'sqlcmd' So the only solution I see right now is defining it again in the

GIT error: fatal: /usr/libexec/git-core/git-submodule cannot be used without a working tree

心不动则不痛 提交于 2020-12-03 07:24:48
问题 I have a git repo with a submodule. I would use in post-receive hook file: git --git-dir="$GIT_DIR" --work-tree="$GIT_WORKDIR1" submodule update --init --recursive but I get the following error: remote: fatal: /usr/libexec/git-core/git-submodule cannot be used without a working tree. I did not get solution for this problem. What should I do to make it work? 回答1: You may see this error if you've renamed the path (working-tree) of a git submodule. In my case I had updated the path in

the receiving end does not support push options

跟風遠走 提交于 2020-05-11 04:31:19
问题 At first my server's git version was 2.7.4 and the error was accurate. Afterwards, however, I updated and have confirmed this with git version: Server $ git --version git version 2.13.0 Client $ git --version git version 2.11.0 (Apple Git-81) Yet when I try to push this happens: $ git push --push-option=test fatal: the receiving end does not support push options fatal: The remote end hung up unexpectedly Even though according to documentation this should be supported in both the client

Git post-receive deployment stops working at random points

给你一囗甜甜゛ 提交于 2019-12-25 04:13:29
问题 I have a post-receive hook setup for git which checks out to dev/staging/production based on the branch. For some reason, dev and staging have worked without issue. But production keeps breaking. After pushing the master branch the updates fail to be checked out to the correct location, despite working after initially being setup. #!/bin/bash while read oldrev newrev refname do branch=$(git rev-parse --symbolic --abbrev-ref $refname) if [ "master" == "$branch" ]; then GIT_WORK_TREE=/var/www

Want Git post receive hook to detect certain file types

▼魔方 西西 提交于 2019-12-24 15:11:00
问题 I would like my post-receive hook to run a certain script whenever files of a certain type, *.hbm.xml are pushed to the server. Motivation: I want to rev my database schema version number whenever NHibernate files are changed. Thanks! 回答1: This is what I came up with: for i in `git show --pretty="format:" --name-only HEAD | grep '.*\.hbm\.xml' `; do # call script here..... exit done 来源: https://stackoverflow.com/questions/5939109/want-git-post-receive-hook-to-detect-certain-file-types

Git post-receive hook not working properly

时光总嘲笑我的痴心妄想 提交于 2019-12-23 02:36:30
问题 I have a server with a git repository. Each time I make a push to that server I would like to regenerate my gitstats documentation for that repository. In that machine if I execute the following command, the gitstats documentation it's refreshed properly: gitstats /home/<username>/<proyect-name>/htdocs/ /home/<username>/gitstats And here it's my post-receive hook in the repository in that server: #!/bin/sh gitstats /home/<username>/<proyect-name>/htdocs/ /home/<username>/gitstats So when I

Git post-receive - how to check if pushed branch is merged with master

倾然丶 夕夏残阳落幕 提交于 2019-12-22 14:51:53
问题 In our team we are usually pushing all tasks into separate branches, and after that release-manager review those branches and merge them into 'master' branch Sometimes team-members forget to merge their branches with master branch(before pushing) - so what I'm trying to do is - output a message "Please merge with master" after user push - I assume I need to check something on post-receive hook on remote.. is there some examples?.. or what I should basically do ? update: main reason for this -

Are concurrent git pushes always safe if the second push only has fast-forwards from the first push?

扶醉桌前 提交于 2019-12-18 15:32:15
问题 This question was migrated from Server Fault because it can be answered on Stack Overflow. Migrated 8 years ago . I want to automatically push commits in the post-receive hook from a central repo on our LAN to another central repo in the cloud. The LAN repo is created using git clone --mirror git@cloud:/path/to/repo or equivalent commands. Because the files being committed will be large relative to our upstream bandwidth, it's entirely possible something like this could happen: Alice