Questions tagged [post-checkout-hook]
5 questions
6
votes
1 answer
Git Hook Fails Silently
I have a post-checkout and post-merge githook with these contents:
#!/bin/bash
# MIT © Sindre Sorhus - sindresorhus.com
set -eux
changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)"
check_run() {
echo "$changed_files"…

jth41
- 3,808
- 9
- 59
- 109
4
votes
3 answers
optional githook behaving as non-optional
I am attempting to make use of this gist in my workflow as post-merge and post-checkout git hooks.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run…

jth41
- 3,808
- 9
- 59
- 109
1
vote
1 answer
Why does TortoiseGit Git Command Progress dialog hang after post-checkout hook starts Notepad?
In my everyday work I use TortoiseGit and I'm trying to write a post-checkout hook. I prefer to work in Windows-environment so the only thing the hook-file does is call a standard windows .bat-file:
#!/bin/sh
echo "The Git post-checkout Linux…

arnold_w
- 59
- 9
1
vote
1 answer
Can a post-checkout hook check if a single file was being checked out?
I'm writing a post-checkout hook, but I'd like to avoid it being run if certain conditions are met, with one of these being upon checkout of a single touched file. For example, I'd like it to run if I run git checkout somebranch, but avoid it being…

0xdd
- 311
- 3
- 15
0
votes
1 answer
How can I prevent git post-checkout hook from executing when I revert files?
I have a git post-checkout hook that automatically re-compiles my Visual Studio project whenever I checkout to a different commit. This works great, but I have noticed that the hook also executes when I do a revert in TortoiseGit, both from the…

arnold_w
- 59
- 9