Is there a way to trigger a shell command automatically after repository update/switch?

I would like to perform a shell command that takes care of cache files and compilation after I have run git pull or svn update (in another project)?

  • gitignore for folder of eclipse projects
  • Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first
  • How can I limit git log (or svn log) to revisions that regard one particular file?
  • Installing Git with Homebrew not working
  • What should I do about user-specific config files (example: .idea/)?
  • How is this a conflict
  • How to merge branch and retain the authorship
  • Force LF line endings using .gitattributes without losing automatic text/binary inference?
  • git maintaining 2 versions of the same project, with different users on each
  • Building tags using Continuous Integration
  • Simple tool to 'accept theirs' or 'accept mine' on a whole file using git
  • What does cherry-picking a commit with git mean?
  • 2 Solutions collect form web for “Is there a way to trigger a shell command automatically after repository update/switch?”

    You can use SVN hooks from command line, on various events(pre- and post-) to run your custom scripts.

    It appears that there is no hook for ‘update’ event, please see here and gather details.

    Regarding SVN: not sure if this will help, but if you use TortoiseSVN, you can use client-side hook scripts:

    There are currently six types of hook scripts available

    Called before the commit dialog is shown. You might want to use this if the hook modifies a versioned file and affects the list of files that need to be committed and/or commit message. However you should note that because the hook is called at an early stage, the full list of objects selected for commit is not available.

    Called after the user clicks OK in the commit dialog, and before the actual commit begins. This hook has a list of exactly what will be committed.

    Called after the commit finishes (whether successful or not).

    Called before the update-to-revision dialog is shown.

    Called before the actual Subversion update begins.

    Called after the update finishes (whether successful or not).

    A hook is defined for a particular working copy path. You only need to specify the top level path; if you perform an operation in a sub-folder, TortoiseSVN will automatically search upwards for a matching path.

    Next you must specify the command line to execute, starting with the path to the hook script or executable. This could be a batch file, an executable file or any other file which has a valid windows file association, eg. a perl script.

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