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

General programming discussion • Using a git repo set on a Zero2W

$
0
0
Hello,

I've set a git repo on a Zero2W to which an extra 64GB large SD card is connected via a USB adapter. The access is by using SSH keys. Checking out, pushing works with full directories but there is one case in which a single file would be enough to checkout and then to push back to the repo later on. It's a Misc/ repo directory with several unrelated misc files of notes, bookmarks, etc. I'd like to checkout one file and what I tried so far is, with a single file named linux.org :

Code:

% git clone --no-checkout git@opia:/mnt/gitrepo/Misc% cd Misc% git checkout main -- linux.org
This works but a git status done right afterwards shows that all other files that were not checked out are staged for deletion :

Code:

Changes to be committed:  (use "git restore --staged <file>..." to unstage)deleted:    bookmarks-2025-08-02-Dev.jsondeleted:    bookmarks-2025-08-02-Mistral.jsondeleted:    dotEmacs-Devdeleted:    go.orgdeleted:    raspinotes
Which is obviously not the effect wanted. And having to 'restore' to unstage those files seems awkward at best.

Is there a simple way to check out only one file, modify it, and then push it back to the repo on the Zero2W without affecting any other repo file ?

Statistics: Posted by mevla — Sat Aug 02, 2025 2:46 pm



Viewing all articles
Browse latest Browse all 8428

Trending Articles