最近一直在学 git ,今早发现Home Assistant的附加元件有一个 Git pull 赶快安装试试
,为什么要用 git 不用我再言,程式员的仓库,长年都使用 Git Hub但最近很开心的自架 GitLab,为了学CI/CD很多企业都在使用,安装好后测试一下竟然可以在 Home Assistant [git push] [git pull],以下分享:
步骤1:安装 SSH & Web Terminal 及 git pull 如下\
步骤2:git pull 设定 如下:
1.自架预设是root
2.Git URL to your repository.可以设定gitlab官网 (需有帐号)
3.要输入帐密
步骤3:到 SSH & Web Terminal
当您建好GitLab repository 他会产生以下程式
照着他的方式便可 git pull git push 了
#Git global setupgit config --global user.name "Administrator"git config --global user.email "admin@example.com"#Create a new repositorygit clone https://xxxx.xxx.xxxx:30003/root/home-assistant.gitcd home-assistanttouch README.mdgit add README.mdgit commit -m "add README"git push -u origin master#Push an existing foldercd existing_foldergit initgit remote add origin https://xxx.xxx.xxx:30003/root/home-assistant.gitgit add .git commit -m "Initial commit"git push -u origin master#Push an existing Git repositorycd existing_repogit remote rename origin old-origingit remote add origin https://xxx.xxx.xxx:30003/root/home-assistant.gitgit push -u origin --allgit push -u origin --tags
如下画面:
Home Assistant push上来的档案: