Skip to content

Instantly share code, notes, and snippets.

@porcelli
Last active May 26, 2020 19:24
Show Gist options
  • Save porcelli/23f573c2f49454a4015f710f44d12a58 to your computer and use it in GitHub Desktop.
Save porcelli/23f573c2f49454a4015f710f44d12a58 to your computer and use it in GitHub Desktop.
Code for blog post: How to setup post-commit hooks on Business Central
$ mkdir myrepo
$ cd myrepo
$ git init
Initialized empty Git repository in /Users/porcelli/blog/myrepo/.git/
$ touch file1.txt
$ git add .
$ git commit -m "first commit"
[master (root-commit) 0fa1a4a] first commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 file1.txt
$ cd .git/hooks/ // <1>
$ echo "#\!/bin/bash\necho Hello World" > post-commit // <2>
$ chmod 755 post-commit // <3>
$ cd ../..
$ touch file2.txt
$ git add .
$ git commit -m "second commit"
Hello World // <4>
[master 3208647] second commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 file2.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment