github.com/q2/git-lfs@v0.5.1-0.20150410234700-03a0d4cec40e/commands/command_update.go (about) 1 package commands 2 3 import ( 4 "github.com/github/git-lfs/lfs" 5 "github.com/spf13/cobra" 6 ) 7 8 var ( 9 updateCmd = &cobra.Command{ 10 Use: "update", 11 Short: "Update local Git LFS configuration", 12 Run: updateCommand, 13 } 14 ) 15 16 // updateCommand is used for updating parts of Git LFS that reside under 17 // .git/lfs. 18 func updateCommand(cmd *cobra.Command, args []string) { 19 updatePrePushHook() 20 } 21 22 // updatePrePushHook will force an update of the pre-push hook. 23 func updatePrePushHook() { 24 lfs.InstallHooks(true) 25 Print("Updated pre-push hook") 26 } 27 28 func init() { 29 RootCmd.AddCommand(updateCmd) 30 }