Skip to content

Re-running the utility does not update the local files #269

Description

@itdoginfo

Expected behavior: I run the utility again and the modified files are synchronized.
But the files remain unchanged.

~$ github-backup --version
github-backup 0.45.1

Steps

  1. Create test repo. My test repo: https://github.com/itdoginfo/test-python-github-backup
  2. Run utility
github-backup itdoginfo --all -f github_key -o /home/user/test-python-github-backup/ -R test-python-github-backup
  1. Check README.md
~$ cat test-python-github-backup/repositories/test-python-github-backup/repository/README.md 
# test-python-github-backup

1
  1. Add string to README.md String after first backup. Main branch
  2. Re-run utility. Identical command from step three
  3. Check README.md
~$ cat test-python-github-backup/repositories/test-python-github-backup/repository/README.md 
# test-python-github-backup

1

Maybe I don't understand something and I need to use some additional flags?

Activity

  1. whwright commented on Jun 14, 2024

    @whwright
    Contributor

    Existing repos will only have their remotes fetched:

    git_command = ["git", "fetch", "--all", "--force", "--tags", "--prune"]

    so checkout the remote branch or merge it into the local copy. git merge origin/main for example

  2. paranerd commented on Jul 4, 2024

    @paranerd
    Contributor

    Thank you for opening this issue. Just ran into the same problem (?)

    Is there a way to either replace git fetch with git pull or run an additional (optional) git merge after fetching?

    I'm using this on a Synology NAS and would like to be able to browse the latest files in the file explorer instead of having to go into the terminal to git merge manually.

    Thanks!

  3. whwright commented on Jul 9, 2024

    @whwright
    Contributor

    This has come up several times, duplicate issue here #196

    You can't assume a merge will always be clean, so IMO this introduces unnecessary complexity to handle potential conflicts and isn't really necessary.

  4. paranerd commented on Jul 9, 2024

    @paranerd
    Contributor

    Yes, I do understand. However, how about at least giving the option. In my case, for example, I use the tool for archive purposes only so will not very likely ever run into any conflicts whatsoever.

    But as long as my data is still backed up even without the additional merge I'm fine with the status quo 😊

  5. josegonzalez commented on Jul 9, 2024

    @josegonzalez
    Owner

    As mentioned in the readme:

    This project is considered feature complete for the primary maintainer @josegonzalez. If you would like a bugfix or enhancement, pull requests are welcome. Feel free to contact the maintainer for consulting estimates if you'd like to sponsor the work instead.

  6. pa-0 commented on Jul 22, 2024

    @pa-0

    @itdoginfo For clarity, when the script fetches 'remote' branches, the git descriptors can be misleading, because those 'remote' branches are actually available locally. You can checkout a remote branch (which, again, is saved on your local drive at this point) or if you're not concerned with losing anything in your local branches, you can run a simple PowerShell script to loop through all repositories, running git merge on each.

    Also, FYI: https://github.com/earwig/git-repo-updater <- Another python script you can simply run after backup in lieu of PowerShell. You could even add a line to the end of github-backup that simply calls this script to achieve the functionality you're requesting.

  7. Iamrodos commented on Dec 3, 2025

    @Iamrodos
    Contributor

    @josegonzalez this can be closed as it was addressed by #457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions