Second, sure, usually, I would make a new repository on some hosted service like github or bitbucket or gitlab. WHYįirst of all, you can’t beat how easy it is to make a bundle and ship it: But for rookies, usually, you’re just trying to ship everything. Unless you use -all, you won’t get all your branches in your bundle! Sometimes, that’s exactly what you want. $ git clone -b master /tmp/myproject.bundle myproject2Īlso, the list-heads command is pretty useful for spying on what is inside a bundle file: Here is how to make a new repo based on that bundle: That can really, really help when you’re on a slow connection or working with big files. See how the second time I ran rsync, it only sent 100 bytes? That’s because it tested if the version of myproject.bundle on was out of sync with the one here. Sent 100 bytes received 59 bytes 16.74 bytes/sec Sent 2,793 bytes received 35 bytes 377.07 bytes/sec $ rsync -e ssh -verbose myproject.bundle :/tmp/myproject.bundle The only advantage of rsync is that it checks if the file needs to be copied again: You might ask why you would use rsync or scp, because they both copy a file over a secure tunnel. Now move the bundle to a remote box via scp or rsync or whatever other method you want. Or make one just with whatever branch you’re working in now: $ git bundle create myproject.bundle master Or you can make a single file (a bundle) that has only the master branch: Here is how to make a single file with everything from all branches: Those are all things that convert a big tree of stuff and spit out a single doodad. If it helps, you can think of git bundle as kind of like tar or zip or even webpack. $ git bundle create myproject.bundle -all You can use git bundle for this! Here is how: Now you want a single file that has your whole project and all the commits you’ve made. $ git commit -a -m "Let's get this party started" $ vi README # pretend this is your brilliant code. You’ve been tracking work with git locally because it is trivial to set up: Pretend you just spent a few minutes, hours, or days trying something out, and now you want to get the project off your janky laptop’s hard drive that you just know is gonna die soon.
0 Comments
Leave a Reply. |