Here's a README for your project:
This Python script syncs commits between two repositories. It is designed to facilitate synchronization between a private git server and GitHub.
- Clones the repository from an upstream URL if it does not exist locally.
- Pulls the latest changes from the upstream repository.
- Pushes the latest changes to the downstream repository.
⚠️ any merge conficts will resolve in error and thus will make the project not sync
The script uses a configuration file named sync.conf to read the repository details. The configuration file should be placed in the same directory as the script.
The configuration file should contain the repository name, upstream URL, and downstream URL, separated by spaces. Lines starting with # are considered comments and are ignored.
Example sync.conf:
#name upstream_url downstream_url
example https://github.com/example_user/upstream.git https://github.com/example_user/downstream.git
- Ensure you have Python installed on your system.
- Place the
sync.conffile in the same directory as the script. - Run the script:
python sync.py- The script reads the configuration file and processes each repository.
- If the repository does not exist locally, it clones the repository from the upstream URL and sets up the downstream URL.
- If the repository exists locally, it pulls the latest changes from the upstream repository and pushes them to the downstream repository.
- Git must be installed and accessible via the command line.
- Ensure you have the necessary permissions to access the repositories.
This project is licensed under the MIT License.
Contributions are welcome! Please fork the repository and submit a pull request.
[Daniel Byomujuni]