I've been wondering how to solve the following problem. I'm currently learning how to modify an OS's source code to my liking, working example being A.S.Tanenbaum's minix.
Say I run minix with qemu and I redirect the ssh port to localhost:10022 (using -net user,hostfwd=tcp::10022-:22), so that I can ssh -p 10022 user@localhost to connect to the system that runs on qemu.
Now, minix's source code is located in /usr/src. I want to have this code locally on my machine -- best in a git repository -- and be able to modify it and then push it and build on the virtual machine.
To summarize, I want:
- To have a copy of
minix's/usr/srcon my machine, in a git repository - To be able to
git pushit from my machine (or anything like that), so that if my changes break the system completely, I can start over from my base image ofminix
I have tried making /usr/src into a git repository that I can clone to my local machine. However, apparently pushing to a non-bare repository is not advisable, and a bare git repository, which doesn't contain any uncommited files, doesn't seem like the way to go.
Also, I would prefer not to brute-force it by just pushing / pulling to another remote.
I would appreciate any hints on how to set up my repositories to create my desired workflow.