A tool to save and restore ignored files inside a Git repositories, based on defined Glob-patterns.
Download the latest release and add the executable to your PATH.
This will save the files local only, without the need of a remote repository.
- Run
repo-file-sync init. - Optionally provide a directory on the machine to store the Database-Repository, however the default one is recommended.
- Select
ywhen asked to set up local only - Follow the instructions to finish the setup.
This will save the files to a remote repository to sync them between multiple devices.
- Run
repo-file-sync initand provide a directory to store the Database-Repository. - Optionally provide a directory on the machine to store the Database-Repository, however the default one is recommended.
- Select
nwhen asked to set up local only - Provide the URL of the remote repository to store the IDE configurations
- For that, set up a new repository on GitHub, GitLab, Bitbucket, etc.
- Copy the URL of the repository and paste it into the prompt
- Follow the instructions to finish the setup.
All following commands support the
--dir <directory>/-d <directory>flag to search and save/restore files in a specific directory. If no directory is specified, the current directory is used.
- Run
repo-file-sync saveto crawl the directory recursively and save all matching files inside the Database-Repository.
- Run
repo-file-sync restoreto search the directory recursively and restore all files from the Database-Repository.
- Run
repo-file-sync discoverto see which files would be saved or restored.
The tool uses a set of global include/exclude patterns to determine which files to save and restore. Additionally, every repository can have its own include/exclude patterns.
Repo File Sync was originally designed to save and restore IDE configurations, so it includes by default the following patterns:
- Visual Studio Code (
**/.vscode/**) - JetBrains IDEs (
**/.idea/**)
- Run
repo-file-sync pattern include add <pattern-1>, <pattern-2>, ...to add one or more Glob-patterns to match files from the repository root.
- Run
repo-file-sync pattern include remove <pattern-1>, <pattern-2>, ...to remove one or more Glob-patterns.
To add or remove a global include pattern, use the
--global/-gflag.
The following patterns are excluded by default, to prevent matching files in some ignored folders:
- Node modules (
**/node_modules/**) - Virtual environments (
**/venv/**,**/.venv/**)
Exclude patterns are evaluated after include patterns, so a file matching an exclude pattern will always be excluded, even if it matches an include pattern.
- Run
repo-file-sync pattern exclude add <pattern-1>, <pattern-2>, ...to add one or more Glob-patterns to exclude files from the repository root.
- Run
repo-file-sync pattern exclude remove <pattern-1>, <pattern-2>, ...to remove one or more Glob-patterns.
To add or remove a global exclude pattern, use the
--global/-gflag.
The tool excludes the following folders when discovering repositories:
- Node modules (
node_modules) - Virtual environments (
venv,.venv)
This has no impact on the saved and restored files. Use the include and exclude patterns to define which files to save and restore.