Probably silly.

Say I've got a remote repo that is only available sometimes, like a removable drive, and I want to add it as a remote, but I don't want to get an error each--

Actually, maybe disregard... I was just poking about in the CLI and remembered that ofc I could add a named remote without adding its pushurl to my main remote like "origin". So it's actually easiest to just do like

# Add the remote
git clone --bare . /mnt/asdf/asdf
git remote add usb /mnt/asdf/asdf

# Push to it by name whenever
git push usb

Seems intuitive to me, but maybe I'm X/Ying it... how would other people go about having a "sometimes" available remote repo, where you want to track easily and efficiently keep track of all the git history?

you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 1 week ago

Yeah, you nailed it.

  • source