Skip to content

danielbyomujuni/Git-Sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Here's a README for your project:


Git Sync Script

This Python script syncs commits between two repositories. It is designed to facilitate synchronization between a private git server and GitHub.

Features

  • 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

Configuration

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.

Configuration File Format

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

Usage

  1. Ensure you have Python installed on your system.
  2. Place the sync.conf file in the same directory as the script.
  3. Run the script:
python sync.py

Script Logic

  • 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.

Requirements

  • Git must be installed and accessible via the command line.
  • Ensure you have the necessary permissions to access the repositories.

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

Author

[Daniel Byomujuni]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages