Home Assistant Git pull

最近一直在学 git ,今早发现Home Assistant的附加元件有一个 Git pull 赶快安装试试
,为什么要用 git 不用我再言,程式员的仓库,长年都使用 Git Hub但最近很开心的自架 GitLab,为了学CI/CD很多企业都在使用,安装好后测试一下竟然可以在 Home Assistant [git push] [git pull],以下分享:

步骤1:安装 SSH & Web Terminal 及 git pull 如下
http://img2.58codes.com/2024/20136076Y89VXFdSY1.jpg\

步骤2:git pull 设定 如下:
1.自架预设是root
2.Git URL to your repository.可以设定gitlab官网 (需有帐号)
3.要输入帐密
http://img2.58codes.com/2024/201360766dDd7twMow.jpg

步骤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

如下画面:
http://img2.58codes.com/2024/20136076b1qGiztfzg.jpg

Home Assistant push上来的档案:http://img2.58codes.com/2024/20136076d09RMa1kyK.jpg


关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章