zeppelin notebook同步到git远程仓库

zeppelin跟git打通配置

zeppelin默认会在本地安装目录创建notebook目录,里面存放配置作业本,采用git进行管理

联通zeppelin跟git远程仓库

  1. 创建git远程仓库路径,这里选择gitlab服务器,也可以选择github
  2. 在zeppelin notebook下加入输入下命令
    1
    2
    3
    git remote add origin http://xxx.com/zeppelin/notebook.git
    git commit
    git push -u origin master

linux git密码存储

1
git config --global credential.helper store

然后执行git相关命令,输入一次密码后,后面请求就不需要了。

自动提交

上述方法需要手工提交,需要自动的话,需要创建.git/hooks/post-commit,并加入如下内容

1
2
#!/bin/sh
git push origin master

然后使用chmod +x post-commit文件即可

错误排查

commit报错

提示remote: GitLab: You are not allowed to push code to protected branches on this project.,这里需要是gitlab的账号跟分支保护机制的问题,maste分支限制只有主程序员权限以上的才允许执行

原创技术分享,您的支持将鼓励我继续创作