Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3436

Advanced users • Seeking clever ideas: applying git changes to a Connect-ed remote pi w/o access to the repository

$
0
0
The situation: I have a couple of pi zero 2 Ws where I've been updating some code vi git pulls from a custom git project, hosted locally on a Mac on my home network. Now, I've deployed those two pi's so they're remote and can't access my local network. I can RPi Connect to get shell access to those machines, where I can edit files, cut and paste, compile, move stuff around, all good. Except I can't figure out how to update the git project.

If the Connect devs had file transfer working, I could just copy over the project directory from an updated machine. Barring that (or hosting my repository somewhere public, which I haven't wanted to do), I'm seeking some clever/hacky way to get a low volume number of modest git commits applied over Connect.

My first thought, which does apply the changes but doesn't commit them (they look like new changes). On a fully updated box:

Code:

git diff oldcommithash newcommithash > patch1.path 
cut and paste the patch onto the remote pi over Connect, then

Code:

git apply patch1.patch
My second half-baked idea, which I think would apply the changes with commits, so the git history would look as if the original commit had been applied normally. On a fully updated box:

Code:

git format_patch yada yada 
cut and paste the result onto the remote pi over Connect, then

Code:

git am blah blah
I would be happy to hear that I'm overthinking this, and that there's some blindingly obvious solution I'm missing...

Statistics: Posted by tinker2much — Thu Sep 05, 2024 7:32 pm — Replies 4 — Views 116



Viewing all articles
Browse latest Browse all 3436

Trending Articles