https://diy-smarthome.com/how-to-set-up-git-to-version-control-your-home-assistant-configuration/
系统自带git,无需安装
Sharing your configuration on GitHub
https://community.home-assistant.io/t/sharing-your-configuration-on-github/195144#step-2-creating-gitignore
quick start
Creating Repository on GitHub
# Initialize the Git repo on Raspberry Pi
Installing Git on Raspberry Pi
Initializing Git on Raspberry Pi
Creating .gitignore
client git push method
客户端有3种提交方式,github.com 对应有3种设置(本文 .https方式)
1.https https://www.msly.cn/boards/topic/13385/git/page/2#18781
2.ssh
https://www.msly.cn/boards/topic/13385/git/page/2#18782
https://diy-smarthome.com/how-to-set-up-git-to-version-control-your-home-assistant-configuration/
3.GitHub Desktop
https://www.iaspnetcore.com/blogpost-5c8eca62fb51d01218b55422-git-
Quick start
First
cd /home/homeassistant20221102/.homeassistant
git init <-- initialize as a version controlled directory
git config user.email "[email protected]"
git config user.name "msly"
git add .
# <-- see what files have been modified.You can enter these commands to get a list of the files in your local Git repository and a status of files that have changed but not committed yet.
git ls-files
git status
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/freemsly/Home-AssistantConfig20221103.git
git branch -M main
git push -u origin main
git remote add origin https://github.com/freemsly/Home-AssistantConfig.git
second
cd /home/homeassistant20221102/.homeassistant
cd /home/homeassistant20221103/.homeassistant
git add .
git commit -m "first commit"
git push -u origin main
https://github.com/settings/profile
https://github.com/settings/apps
https://github.com/settings/tokens
Check that you have git installed.
which git
/usr/bin/git <-- already installed
Step 1: Installing and Initializing Git on Raspberry Pi
#<-- update your packages
sudo apt update
sudo apt upgrade -y
#<-- install git if needed
sudo apt install git
output
root@raspberrypi:~# sudo apt update
sudo apt upgrade -y
sudo apt install git
命中:1 http://archive.raspberrypi.org/debian stretch InRelease
0