by-pass pre-commit/commit-message hooks while cherry-picking

3,796 views
Skip to first unread message

Chinmay DasMohapatra

unread,
Sep 25, 2013, 4:26:16 AM9/25/13
to repo-d...@googlegroups.com
Dear All,

Is there any way i can by-pass the commit hooks while doing a cherry-pick from some other branch?

Thanks

Magnus Bäck

unread,
Sep 25, 2013, 2:19:12 PM9/25/13
to repo-d...@googlegroups.com
On Wednesday, September 25, 2013 at 04:26 EDT,
Chinmay DasMohapatra <chinmay.da...@gmail.com> wrote:

> Is there any way i can by-pass the commit hooks while doing a
> cherry-pick from some other branch?

The -n/--no-verify option to 'git commit' inhibits the pre-commit and
commit-msg hooks. See git-commit(1). When doing a cherrypick I suppose
you have to use its -n option too to avoid creating the commit, i.e. the
sequence becomes:

git cherry-pick -n $COMMIT
git commit -n

--
Magnus Bäck
ba...@google.com

Chinmay DasMohapatra

unread,
Sep 26, 2013, 2:07:02 AM9/26/13
to repo-d...@googlegroups.com
Thanks Magnus. It is working.
--
Chinmay
Reply all
Reply to author
Forward
0 new messages