How to achieve 'pre-checkout' hook in Git/bitbucket?

后端 未结 3 689
故里飘歌
故里飘歌 2021-02-19 10:41

Result of lots of searching on net is that pre-checkout hook in git is not implemented yet. The reason can be:

  • There is no practical use.
相关标签:
3条回答
  • 2021-02-19 10:45

    I got the reason why it was not implemented. In my situation I do backup the database and store it in a file, which will fail the check-out every-time. So this will be impractical to implement this functionality.

    0 讨论(0)
  • 2021-02-19 10:47

    You could write a script that does your backup then checkout. Then create a shell alias so it runs that script instead when you type git checkout.

    0 讨论(0)
  • 2021-02-19 11:06

    Pre-checkout use case: delete un-versioned local files generated by gulp watch:css task so they are overwritten after checkout and rebuilt by gulp.

    Instead, I'm just going to write a shell script that gets the repo root and then deletes any of a list of gulp-generated files found.

    0 讨论(0)
提交回复
热议问题