I need to work on an offline machine, where I cannot access my repository. Now I also don't want miss out on using Git altogether.
Questions:
Edit: I should have stated, that I will have to hand over the memory stick to an administrator who will do the copying for me, i.e. I cannot mount the stick with my user.
Yes you can, but there's no need to copy the full working tree. You can copy just the . git folder without the working tree (i.e. as a "bare" repo) and then checkout the latest working tree on the other machine.
To copy a complete Git repo, you just have to copy the folder .git
; it contains everything. Git uses safe file names and ignores time stamps inside of the repo, so this data is safe from the usual file system quirks.
On the target machine, create a folder, copy the .git
folder inside. Now git checkout <branch>
will get you a working copy.
If you want to move patches back and forth instead of the whole repo, then git format-patch <branch>
creates them. The command will create all patches necessary to update a remote repo (i.e. the output will contain everything that hasn't been pushed, yet). you can also give it commit IDs (= start with this commit) or ranges.
To apply them, use git am < 0001....
on the remote repo.
Related:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With