[fpc-other] (Probably trivial) git help, please
Martin Frb
lazarus at mfriebe.de
Sun Oct 26 17:03:58 CET 2025
On 26/10/2025 16:20, Brian via fpc-other wrote:
>
> You would be correct the first time, but then I tried using p7zip to
> pack up the entire directory and copied that across, then unpacked it,
> and it still had problems. I could have tried moving rather than
> copying, but then that leaves me with a problem that I have to do
> another copy as I'm using the old drive as my backup device. I think
> I'm about to start writing my own very specific backup utility!
Well, if you want one of the drives to be backup of the other, then you
need to keep syncing them.
So just "git clone" between the drives.
On the new empty folder
git clone --origin=backup /mount/foo/existing_repo ./new_repo_folder
then
cd new_repo_folder
git remote add origin https://git_remote_server_url
You can also create a new empty repo, add that to your backup, and push
everything.
That means that then your backup will be pulling, and your new repo will
not show the remote branches for the backup.
Having the backup pull also avoids "force pushes" if your working repo
gets branches rebased (should you ever do that).
More information about the fpc-other
mailing list