For copying your repo to the memory-stick, simply use git clone
, and then use git pull
to update it.
E.g., on your online computer, with the memory-stick mounted, do
cd <memory-stick-mount-point>
git clone <local-path-to-git-repo>
now the <local-path-to-git-repo>
will be the origin
remote for the repo on your usb-stick, so later you can
simply use git push/pull
(when mounted on the online machine) to sync your offline work.
The git repo on the memory stick is self-contained, so now you can work against that on any computer, and then sync as above when you mount it on your online machine.
Edit, re: not being allowed to mount the stick yourself:
If you can ask the admin to git clone
the repo onto the memory stick it is fine. Otherwise, your admin can simply copy the entire project.git directory (if it's a bare repo) or project/.git (otherwise) to your memory stick, and you can work against that, the thing to watch out for is that the remotes, etc. will be those of the online machine.
Then, pulling is not a problem, but pushing may need a further work-around if you don't trust your sysadm to resolve your merge conflicts for you.
If you have your own branch(es) then merging is not a problem.
Otherwise
to do merges "offline", you could have two offline copies of the repo, one that you work on, and one that is your "origin", and when you get back, ask the sysadm to git pull to the "origin" repo, and then, on an offline computer, do the merge between the two memory-stick repos, and then ask the sysadm to merge your origin repo into the online one.
This feels a bit brittle and open to race conditions, though, so I'd really try to create separate branches before "going offline".