...
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 mastermybranchname
.
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 "mastermybranchname"] remote = origin merge = refs/heads/mastermybranchname
.
Push local configuration to masterto mybranchname
Code Block language bash theme RDark OMD[mysite]:~/etc/check_mk$ git push --set-upstream origin masterUsernamemybranchnameUsername 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] mastermybranchname -> mastermybranchname Branch 'mastermybranchname' set up to track remote branch 'mastermybranchname' 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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
...