Since "testing" is a common use for a Git hook, my question is hard to search for.
I'm writing a fairly involved git post-receive hook and want to know what the best way to test it is. Currently my process is:
- make changes to post-receive in a dummy "remote" repo
- make a change to a dummy local repo
- commit change in dummy local repo
- push change to dummy remote repo
Is there any easier way to test this? Ideally it would look like:
- make change(s) to post-receive in a dummy repo
- issue "magic" command to test post-receive
Perhaps I can "reissue" a previous push or have the remote repo act as though it just received a push with a specific hash?
question from:
https://stackoverflow.com/questions/11512155/how-to-test-git-hooks 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…