I have a remote server on which I have created a bare git repository.
I would like to create a hook so that a given script is run on the latest code received on any given branch.
I know the post-receive
hook can be used for it. However I want to do the following:
- Get hold of the branch on which code was received.
- Checkout the code in a temp location and run an operation on it.
How do I do the above?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…