...
Status | ||||
---|---|---|---|---|
|
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Step-by-step guide
- Go to Setup → General → Global Settings → Edit global setting
- Place an X to enable GIT version control
. - Click Save
. - Activate changes
Git ignore
By default, Checkmk creates the following .gitignore files:
...
~/etc/check_mk/conf.d/wato/.gitignore
Code Block language bash theme RDark title ~/etc/check_mk/conf.d/wato/.gitignore OMD[mysite]:~/etc/check_mk/conf.d/wato$ cat .gitignore !*
Push to a remote repository
Add repository
Code Block language bash theme RDark OMD[mysite]:~/etc/check_mk$ git remote add origin https://github.com/mygituser/test.git
.
Setup the upstream branch
Code Block language bash theme RDark OMD[mysite]:~/etc/check_mk$ git push --set-upstream origin mybranchname
.
Verify the git configuration
Code Block language bash theme RDark OMD[mysite]:~/etc/check_mk$ cat ~/etc/check_mk/.git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [user] email = check_mk name = check_mk [remote "origin"] url = https://github.com/mygituser/test.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "mybranchname"] remote = origin merge = refs/heads/mybranchname
.
Push local configuration to mybranchname
Code Block language bash theme RDark OMD[mysite]:~/etc/check_mk$ git push --set-upstream origin mybranchnameUsername for 'https://github.com': mygituser Password for 'https://mygituser@github.com': Enumerating objects: 65, done. Counting objects: 100% (65/65), done. Delta compression using up to 8 threads Compressing objects: 100% (55/55), done. Writing objects: 100% (65/65), 30.69 KiB | 10.23 MiB/s, done. Total 65 (delta 6), reused 39 (delta 1), pack-reused 0 remote: Resolving deltas: 100% (6/6), done. To https://github.com/mygituser/test.git * [new branch] mybranchname -> mybranchname Branch 'mybranchname' set up to track remote branch 'mybranchname' from 'origin'.
.
Tip Manage your personal access tokens
Automate Git push
If you would like to automate Git push, you can do this with a Git post commit hook
Create the post-commit file
Code Block language bash theme RDark OMD[mysite]:~$ vi ~/etc/check_mk/.git/hooks/post-commit
.
Add the following
Code Block language bash theme RDark title ~/etc/check_mk/.git/hooks/post-commit #!/bin/sh git push -u origin mybranchname
.
- Save the file
. Make the file executable
Code Block language bash theme RDark OMD[mysite]:~$ chmod +x ~/etc/check_mk/.git/hooks/post-commit
Useful commands
Panel | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...