https://github.com/powershelllibrary/git-sync
Simply push from git repo from one remote to other
https://github.com/powershelllibrary/git-sync
backup git github powershell powershell-script repositories repository repository-management repository-tools repository-utilities ssh-agent ssh-key sync
Last synced: 7 months ago
JSON representation
Simply push from git repo from one remote to other
- Host: GitHub
- URL: https://github.com/powershelllibrary/git-sync
- Owner: PowerShellLibrary
- License: mit
- Created: 2018-03-04T20:57:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-02-01T21:32:23.000Z (12 months ago)
- Last Synced: 2025-03-14T10:43:38.683Z (10 months ago)
- Topics: backup, git, github, powershell, powershell-script, repositories, repository, repository-management, repository-tools, repository-utilities, ssh-agent, ssh-key, sync
- Language: PowerShell
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-sync
Git-Sync helps you sync your repositories across multiple remotes.
The main goal of this script is to create enough redundancy so even if a single provider will fail you can still access your code using alternative hosting companies.

## How to use
### 1. Generate SSH key
```powershell
cd c:\Users\[USER_NAME]\.ssh\
ssh-keygen.exe
ssh-add.exe id_rsa
notepad.exe id_rsa.pub
```
In case you are using SSH agent delivered with Windows make sure that you enabled the **ssh-agent** service
To solve this problem
> Error connecting to agent: No such file or directory
follow instructions below
```powershell
Set-Service -Name ssh-agent -StartupType Manual
Start-Service ssh-agent
Get-Service ssh*
```
### 2. Add SSH keys to your alternate hosting websites
Go to you repository hosting website and add key generated in previous step.
Here are some examples:
- `https://[USER_NAME].visualstudio.com/_details/security/keys`
- `https://bitbucket.org/account/user/[USER_NAME]/ssh-keys/`
- `https://github.com/settings/keys`
### 3. Create configuration
- Rename `config-example.json` into `config.json`
- Add your configuration
### 4. Run script
```powershell
.\sync.ps1
```
## License
[MIT](LICENSE)