githooks

Cannot trigger post-commit git hook on git submodule

僤鯓⒐⒋嵵緔 提交于 2019-12-08 02:52:10
问题 We use a git module with several submodules. In order to make it more convenient for daily use, I wanted to have a post-commit hook which automatically adds the submodule to the git index in the main/super/root git repo/clone/module such as git add mychangedsubmodulename so as to prepare a commit ready to update the submodule's commit reference in the main repo and probably more ideas to come. The .git folder is located inside the main module root folder and seems to contain as well the

How do I ask git to merge branch back to parent

£可爱£侵袭症+ 提交于 2019-12-07 23:48:12
问题 Is there a way to write an alias that merges a branch back to its parent? I know I can do: git checkout - && git merge - But it only works in simple cases when my previous branch is the parent branch. As far as I know git does not track this kind of information because there is no branches in there. But I hope it's already implemented as a plugin or a hookset. Thanks in advance. 回答1: Such an alias would involve first finding the "parent" branch. It isn't trivial, and the question "Find the

specify which hook to skip on git commit --no-verify

社会主义新天地 提交于 2019-12-07 23:38:45
问题 If there a way to specify exactly which git-hook to skip when using --no-verify ? Or is there another flag other than --no-verify to accomplish this? Perhaps just a flag to only skip pre-commit ? I have two hooks that I regularly use, pre-commit and commit-msg . pre-commit runs my linting, flow check, and some unit tests. commit-msg appends my branch name to the end of the commit message. There are times that I would like to --no-verify the pre-commit but would still like to have commit-msg

How can I find out what files have changed in the post-checkout hook in git?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 18:34:27
问题 I'm only new to git and I'm looking at the post-checkout hook. As I understand it the following command will restore "filename" from the latest commit: git checkout -- filename When I get control in post-checkout I get 3 arguments, namely 2 SHAs and a type. Both the SHAs are the same, namely the SHA of the last commit and type has a value of 0 which means a checkout of a file occurred. But home do I find out what file was checked out? 回答1: The documentation says: The hook is given three

How to apply server side hooks in TFS - Git repositories

爷,独闯天下 提交于 2019-12-07 18:28:10
问题 I am working on SVN to git migration project. I would like to apply server side hooks(like check in commits and other basic checks on code) in TFS-Git repositories. I couldn't find any documentation online. Has anyone worked on this area. could you please share your knowledge with me. 回答1: You can't. TFS/VSTS Git repos currently do not support Git hooks. 来源: https://stackoverflow.com/questions/44296831/how-to-apply-server-side-hooks-in-tfs-git-repositories

GitHub Enterprise Hook to only allow certain users to commit?

霸气de小男生 提交于 2019-12-07 17:54:17
问题 Does anyone know of a hook for GitHub Enterprise which will allow me to only have certain accounts on a repository commit to certain branches? Sorry if this is a basic question just kicking off this GitHub stuff. What I am setting up is a public project - All engineers can push and pull Master Branch is controlled by Dev Lead and is only the shipping code. Development branch is where all dev happens. I want to make sure that and engineer not authorized does not commit to master. and if they

Git hooks, post-receive loop through commit

随声附和 提交于 2019-12-07 15:13:21
问题 Using git hooks on the server side, is it possible to loop through the new commit messages that were sent from the client to the server everytime someone pushes to the remote repository? I need to extract information from each message, hash,date,commit author,branch I cant find any good documentation on git hooks figure it out. I've read through git post-receive hook that grabs commit messages and posts back to URL and I don't understand a simple line of code 回答1: As is explained in the

How can I reject git pushes on an origin repo from a local repo if it does not pass unit tests?

独自空忆成欢 提交于 2019-12-07 12:27:26
问题 I have an origin repo that I have full access to and I don't want code to be pushed successfully to this repo unless the code being pushed successfully passes my unit tests. I saw many examples of .git/hooks/update scripts and they seem to break down into a few categories that do not fit my use case. For example, in (http://git-scm.com/book/en/Customizing-Git-An-Example-Git-Enforced-Policy), the script accesses files locally in the .git/hooks/ directory (ACL example) or individual files in

Is there a way to make a local branch immutable?

萝らか妹 提交于 2019-12-07 11:02:32
问题 I'm extremely stupid and sometimes I merge a "feature branch" in the wrong master branch as opposed to the develop branch and that of course leads to pain and suffering. Since it's the second time already that this has been happening, I wonder if there's a way for me to make a branch immutable locally. I've already tried with this pre-commit hook to prevent me from directly making commits on said branch, but this is not stopping merges as in: git checkout master git merge wip Is there a way

Can I send out of band data along with a commit?

自作多情 提交于 2019-12-07 05:43:41
问题 I wish to integrate a remote git repository with an RTC server, by using their RESTful interface to attach a link to gitweb for a commit associated with a particular task. Ideally this will be done with a post-receive hook on the git server, but the processing user that git runs as is not allowed a user account to authenticate to RTC. The best solution I can think of is to somehow pass an authentication token (Acquired from RTC in the form of cookies.txt) along with the git push (But not have