The fastest way: use the File Editor add-on to paste the raw file URL
Home Assistant has a built-in File Editor add-on that lets you read files directly from GitHub without touching the command line. Open the File Editor from your Home Assistant sidebar, navigate to the folder where you want the file to land, and use the folder's menu to create a new file. Paste the contents from GitHub's raw file view — click the Raw button on any GitHub file page to see the plain text version — then save.
This method works for configuration files, automations, scripts, and most text-based files. It is slower than other methods if you are moving many files at once, but it requires no technical setup and you can see exactly what you are pasting before you commit it.
Key Takeaways
- The File Editor add-on is the safest starting point because you can review the file contents before saving and you do not need to use the terminal.
- GitHub's Raw button shows you the plain text version of a file, which is what you copy and paste into Home Assistant.
- For entire folders or many files at once, cloning the repository with Git is faster than copying files one by one.
- Home Assistant's SSH add-on or a terminal connection lets you use Git commands, but requires you to authenticate to GitHub first.
- Always check the file path in Home Assistant's documentation or the GitHub repository's README to know where each file should go.
Using Git to clone an entire repository at once
If you need multiple files or a whole folder structure from GitHub, cloning the repository is faster than copying files one at a time. Home Assistant runs on Linux, so you can use Git commands if you have terminal access. Enable the SSH & Web Terminal add-on from the add-on store, then open a terminal session.
Navigate to the folder where you want the files to land — usually /config for your Home Assistant configuration directory — and run git clone https://github.com/username/repository-name.git. Replace the URL with the GitHub repository's clone link, which you can copy from the green Code button on the repository page. Git will read the entire folder structure and all files in one command.
This method preserves the folder layout exactly as it exists on GitHub, which matters if the files depend on being in specific subdirectories. It also makes it easier to pull updates later if the repository changes.
Authenticating to GitHub if the repository is private
Public repositories on GitHub do not require authentication — you can clone them or view raw files without logging in. If the repository is private, you need to prove you have permission to access it. The easiest way is to create a personal access token on GitHub instead of using your password.
Go to GitHub Settings, select Developer Settings, then Personal Access Tokens. Create a new token with repo scope (which gives read access to private repositories). Copy the token when ready — GitHub will not show it again. When Git asks for a password during cloning, paste the token instead of your actual password.
If you are cloning a private repository often, you can store the token so you do not have to paste it every time. In your Home Assistant terminal, run git config --global credential.helper store, then clone once with the token. Git will remember it for future commands.
Copying individual files using the raw GitHub URL
For a single file or a few scattered files, you can read them directly without using Git. On GitHub, open the file you want, click the Raw button, then right-click and select Save As to read it to your computer. Upload it to Home Assistant using the File Editor's upload button, or paste the contents directly if the file is small.
Alternatively, you can construct a read URL and use Home Assistant's terminal to fetch the file in one command. The raw URL format is https://raw.githubusercontent.com/username/repository-name/branch-name/path/to/file.yaml. In the terminal, run curl -o /config/path/to/file.yaml https://raw.githubusercontent.com/username/repository-name/branch-name/path/to/file.yaml to read it directly into the right location.
Checking file paths and folder structure before you copy
Home Assistant is strict about where files go. A configuration file that belongs in /config/automations/ will not work if you put it in /config/ by mistake. Before you copy anything, check the repository's README file — most well-maintained repositories explain where each file should be placed. If there is no README, look at the folder structure on GitHub and match it in your Home Assistant installation.
Some repositories include a setup script or installation instructions that tell you exactly which files to copy and where. Follow those instructions rather than guessing. If you copy a file to the wrong location, Home Assistant will not see it, and you may spend time troubleshooting a problem that is really just a path mismatch.
Restarting Home Assistant after copying configuration files
Home Assistant does not automatically reload configuration files when you add or change them. After you copy a new automation, script, or integration configuration, you need to restart Home Assistant or reload the specific component. Go to Settings, then System, then Restart to restart the whole system. This takes a few minutes and temporarily stops all automations and integrations.
If you only changed automations or scripts, you can reload just those components without restarting everything. Go to Developer Tools, select Services, search for the component name (like Automation: Reload), and run the service. This is faster and does not interrupt other automations that are running.
Troubleshooting common copy and paste problems
If a file you copied does not work, the most common causes are wrong file path, incorrect indentation in YAML files, or missing dependencies. YAML is sensitive to spacing — if you copy a file and the indentation changes (for example, if your text editor converts tabs to spaces), Home Assistant will reject it. When you paste into the File Editor, make sure the indentation looks the same as it did on GitHub.
If you get a permission error when cloning a repository, you may not have write access to the folder you are trying to clone into. The /config directory should always be writable, but if you are trying to clone into a system folder, you may need to use sudo or clone into a different location first, then move the files. If you get an authentication error, double-check that your personal access token is correct and has the right permissions.
Frequently Asked Questions
Do I have to use the command line to copy files from GitHub?
No. The File Editor add-on lets you copy files by pasting their contents, and you can upload files directly through the web interface. The command line is faster for large repositories or many files, but it is not required.
What is the difference between cloning and downloading a ZIP file?
Cloning creates a Git repository on your Home Assistant system, which means you can pull updates later if the original repository changes. Downloading a ZIP gives you a snapshot of the files at that moment, but you have to manually re-read if you want updates. Cloning is better if you plan to keep the files long-term.
Can I copy files from a private GitHub repository?
Yes, but you need to authenticate first. Create a personal access token on GitHub with repo scope, then use it as your password when Git asks for authentication. The token proves you have permission to access the private repository.
What do I do if the file I copied is not showing up in Home Assistant?
Check three things: the file is in the correct folder (check the repository's README or folder structure), the file name matches what Home Assistant expects, and you restarted Home Assistant or reloaded the component after copying. YAML indentation errors also prevent files from loading — compare your copied file to the original on GitHub line by line.
Is it safe to copy files from any GitHub repository?
Only copy from repositories you trust. Read the code before you paste it, especially if it is a script or automation that will run on your system. Check the repository's stars, recent updates, and issue history to get a sense of whether it is actively maintained and whether other users have reported problems.