git hooks : is there a clone hook?

We want to store some meta-information about the commit in an external database. During a clone or a checkout, this database should be referred and we copy the meta information to a file in the repo which is cloned. The database is required rather than just using a file is for the sake of indexing and searches etc …

I thought if there is a clone hook, we could trigger this. I couldn’t find the clone hooks in the sample in .git/hooks. is there one? is post-checkout hook the only possibility at client side?

  • GitHub add users to work together on repo…?
  • How to manage a project dependent on another project in Git?
  • Configure git mergeoptions --no-edit on all branches
  • GitKraken won't push to new remote (“Select remote branch to push/pull with 'master': ”)
  • How to diff one file to an arbitrary version in Git?
  • Setting up GIT and workflow for bigger web based application
  • Git push gives Error reading command stream
  • Multiple Developers + Single Dynamics CRM Instance + Git - How to overcome challenges?
  • SSH is looking in the wrong place for the public/private key pair on Windows
  • Git - Save Work in Progress — Changes Missing After Branching
  • Git commit that doesn't override original authors in git blame
  • Visual Studio 2013 Update 3 Process taking up 30% CPU for a long time after commit
  • 3 Solutions collect form web for “git hooks : is there a clone hook?”

    ok, one way to do this is to use the clone --template option.

    Specify the location where the client side hooks will be stored as value to the --template switch. The hooks are copied to the clone, and the post-checkout hook is fired immediately!

    When you clone a remote repository, you can’t run any client-side hooks because hooks are local to your working copy, and you’re creating one from scratch. When you pull new changes from a remote repository, git will run your local post-merge hook if it exists.

    There is nothing run on the server as the result of a pull operation. A push operation will trigger the servers’s update and post-update hooks.

    See the Git Book for more information.

    No, there isn’t any clone hook.

    Git Baby is a git and github fan, let's start git clone.