GitHub Manager

Phase 1 — Repository Initialization

  • Implement git_manager.py <repo_url> <local_dir> to clone a repository if it does not exist locally
  • Verify the repository exists and is accessible in the given directory
  • Ensure that the repository can be opened and basic Git commands work

Functional result: Running the script with a new repository URL clones it locally; existing repository is detected and used.


Phase 2 — File Monitoring

  • Detect new or modified files in the local repository compared to the last commit
  • List all files that need to be committed or pushed
  • Handle basic file types (text and binary) for change detection

Functional result: Running the monitoring phase prints a list of local changes ready for commit.


Phase 3 — Automated Sync

  • Pull latest changes from the remote repository at configurable intervals (e.g., every X hours)
  • Commit and push local changes automatically if there are updates
  • Maintain repository in sync without manual Git commands

Functional result: Local repository updates and pushes automatically; remote changes are pulled successfully.


Phase 4 — Conflict Resolution

  • Detect merge conflicts when pushing changes to remote
  • Automatically resolve conflicts by keeping local changes and discarding conflicting remote changes
  • Print short confirmations for each resolved file

Functional result: Conflicted files are automatically resolved; push completes without errors while preserving local edits.