Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
itdoginfo opened this issue Apr 2, 2024 · 6 comments
Open

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

itdoginfo opened this issue Apr 2, 2024 · 6 comments

Comments

@itdoginfo
Copy link

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?

@whwright
Copy link
Contributor

whwright commented Jun 14, 2024

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

@paranerd
Copy link
Contributor

paranerd commented Jul 4, 2024

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!

@whwright
Copy link
Contributor

whwright commented Jul 9, 2024

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.

@paranerd
Copy link
Contributor

paranerd commented Jul 9, 2024

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 😊

@josegonzalez
Copy link
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.

@pa-0
Copy link

pa-0 commented Jul 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants