Arafangion
Arafangion

Reputation: 11910

How do I script git in such a way that hooks are bypassed?

I am looking for an elegant way to checkout a file from a particular committish, without causing the checkout hooks to fire.

Eg, I do not want:

git checkout foo/bar/baz.txt

to result in the post-checkout hook firing.

Upvotes: 2

Views: 68

Answers (2)

CB Bailey
CB Bailey

Reputation: 791849

git reset <commitid> foo/bar/baz.txt
git checkout-index -f foo/bar/baz.txt

Upvotes: 1

Adam Dymitruk
Adam Dymitruk

Reputation: 129566

git show HEAD:foo/bar/baz.txt | sed -e 'some funky stuff to correct line endings' > foo/bar/baz.txt

Upvotes: 2

Related Questions