HA config folder and git branch

Hi All,

Does someone know if you can use a different branch on the config folder to do some tests?

Normally I edit the yaml file and test it. Commit to git.
But sometimes I want make big changes and try something new for everything.

I thought when I create a new branch. So I can work in that one and see what happen… if not move back to the main.

Im not a star with git but know the basic commands… :slight_smile:

Yes, simply create a new branch using the terminal commands in the HA config folder to create a local branch (note I’m checking out the main branch first, yours might be master):

git checkout main
git checkout -b my-branch-name

If you want you can push the branch to your repo and then use the Github Website to create a Pull request back to your main or master branch

git push origin my-branch-name

Once you complete the pull request switch the HA Config back to the main / master branch:

git switch main

note: the switch command is in Git v2.23.0 or later - if you are using an earlier version just use ‘git checkout main’

You can delete your test branch from the local HA config using:

git branch -d my-branch-name

Note: this checks if the branch is fully merged with the upstream. If you use ‘-D’ instead of ‘-d’ it will force the delete.

1 Like

Thank you for the clean explanation !!! This helped me out.
Now I can do some big tests without changing the master branch :slight_smile:

//never to old to learn