LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 May 15 2015

Adnan
Member

Where / How do you store your code ?

« Back up my hard drive ? How do I put it in reverse ? » - Anon.

Hi,

I'm panicking about losing all the code that I write and store on my hard disk someday when the latter fails its duty. I am asking about code in particular, and not exclusively about backing it up.

For now I copy what is deemed important into my Dropbox, and use that as a backup medium. I've tried using GitHub but got quickly confused by its usage, probably because I haven't RTFM for long enough, but also because I found no medium of seamlessly syncing my local folders with the cloud (as in the Dropbox approach).

I don't have any big projects, so I think that just uploading my projects folders to Dropbox does the job, but I would like to enquire from some of you who might have a lot of written code, with multiple versions, etc ... Do you use Github / Bitbucket or similar websites ? What could be the advantages ? Or you just go with classical backups ?


Thanks.

Last edited by Adnan (May 15 2015)

Offline

#2 May 15 2015

mmk92
Member

Re: Where / How do you store your code ?

http://upload.wikimedia.org/wikipedia/c … ed.svg.png


This is very helpful if git is what's confusing you. Otherwise if it's Github that's the problem, there's alternatives such as bitbucket.

Offline

#3 May 16 2015

Johnaudi
Member

Re: Where / How do you store your code ?

I usually use Google Drive which can automatically sync your code.

Offline

#4 May 17 2015

xterm
Moderator

Re: Where / How do you store your code ?

Use a tool specific for the job; A version control tool like Git-scm/Mercurial/Bazaar and family gives you more than just a storage. It gives you a way to track the history of the project, a way to go back to earlier versions, it allows others to collaborate with you, it allows you to experiment with very minor overhead if any.

Each of these tools also has a graphical front-end and an online service that gives you great ways to track your project's evolution and share with others. As a developer/programmer/scientist/engineer learning version control is a great investment. You will thank yourself tomorrow.

I myself prefer Git.

If you prefer video-style learning start at codeschool.
If you prefer reading documentation (which you should). Start at Git-scm Documentation Site

Good luck and don't hesitate to ask questions.

Offline

#5 May 17 2015

rolf
Member

Re: Where / How do you store your code ?

Simple solution: the code lives on your hard drive (external maybe but doesn't have to be) and every week or so you make a backup of it on an external storage. If you really wanna be paranoid you do a backup over a network to a remote location so you have your data in two different locations in case say there is a bad fire in one. But if it happens I guess your code will be the last one of your concerns :)
You would be very unlucky if both drives fail at the same time. And even then there is usually a way to recover data from the drive.

Last edited by rolf (May 17 2015)

Offline

#6 May 18 2015

Adnan
Member

Re: Where / How do you store your code ?

rolf wrote:

Simple solution: the code lives on your hard drive (external maybe but doesn't have to be) and every week or so you make a backup of it on an external storage. If you really wanna be paranoid you do a backup over a network to a remote location so you have your data in two different locations in case say there is a bad fire in one. But if it happens I guess your code will be the last one of your concerns :)
You would be very unlucky if both drives fail at the same time. And even then there is usually a way to recover data from the drive.

Haha, I know ! I already have my non-code stuff backed up, but I was looking for a way to keep my necessary code backed up as cleanly and efficiently as possible so I don't end up with a mess.

Thanks for your replies, I'm really interested in Git, and will try to switch to it when I feel like learning something new.

Offline

#7 May 18 2015

user
Member

Re: Where / How do you store your code ?

private gitlab server from digital ocean, 10$ a month, basically unlimited code (well, 30 GB worth anyway) with their histories. Before that I was going the cheapskate way of hosting my own gitlab server at home and using noip to reverse dns, and virtualbox to host ubuntu server, which makes backups and restores easier than just installing directly on the computer. And I was taking weekly backups on 3 hard disks, I later figured, it is too much work to save 10$ a month.

Speaking of virtualbox, I do all my coding inside virtualbox(ubuntu server os), whether it is web or android java or whatever. And I use netbeans on windows to connect to the server (as far as it is concerned it is a remote machine although it is actually the same one) the reason being, it is super easy to backup everything as it is. You simply export the machine. And if anything happens to your computer or if you ever change your computer, you just plug an old image from a usb and do an import, and then everything is just there.

Last edited by user (May 18 2015)

Offline

#8 May 18 2015

ironman
Member

Re: Where / How do you store your code ?

user wrote:

private gitlab server from digital ocean, 10$ a month, basically unlimited code (well, 30 GB worth anyway) with their histories. Before that I was going the cheapskate way of hosting my own gitlab server at home and using noip to reverse dns, and virtualbox to host ubuntu server, which makes backups and restores easier than just installing directly on the computer. And I was taking weekly backups on 3 hard disks, I later figured, it is too much work to save 10$ a month.

Speaking of virtualbox, I do all my coding inside virtualbox(ubuntu server os), whether it is web or android java or whatever. And I use netbeans on windows to connect to the server (as far as it is concerned it is a remote machine although it is actually the same one) the reason being, it is super easy to backup everything as it is. You simply export the machine. And if anything happens to your computer or if you ever change your computer, you just plug an old image from a usb and do an import, and then everything is just there.

but you still have a risk, that the machine might not boot (using virtual box) or the virtual disk going into corruption.
watch out.

Good luck :)

Last edited by ironman (May 18 2015)

Offline

#9 May 18 2015

user
Member

Re: Where / How do you store your code ?

I know, it happened many times before, which is why the combination of an always on gitlab that backs up everything and a virtualbox where I code (when I hosted my own gitlab they were 2 virtualboxes, and gitlab was always on) one server can replace the other in case of failure. You can't backup enough, but with digitalocean there is an almost non existent chance of corruption or anything because it's a cloud server on raid disks etc...

edit: also do backups after major coding changes.

Last edited by user (May 18 2015)

Offline

#10 June 15 2015

tbaba
Member

Re: Where / How do you store your code ?

you can always use Bitbucket, free and easy to sync ;)

Dropbox, ondrive, drive, etc.. all these clouds are good to save information on it but they are not built to backup the code as well as github and Bitbucket, you wont have a backroll for the code

Offline

#11 June 16 2015

rolf
Member

Re: Where / How do you store your code ?

https://bitbucket.org/rolfen/

I use Git to push, but Bitbucket also supports Mercury and SVN (AFAIK).

Offline

Board footer