Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Source Control - If, Why, How to start? [duplicate]

Possible Duplicate:
Using Source Control

So, although even here on Stack Overflow are literally dozens things on version control, I can't find something nice to answer all my questions. If you have anything to say or post a link, please do it here.

1., Do I need to start with version control?

While most people agree, that even single developer/programmer should start with version control, nobody (or at least in understandable form) tells

2., How?

In my nature is that I need to know what means CVS, SVN, Tortoise, Git, GitHub and what are the differences, but I struggle to find some dead simple kick-start into world of version control.

As a developer/programmer, I worked or studied almost every programming/markup language, that is major (from Pascal to Java, from HTML to PHP) and used dozens of editors, IDEs and programs. And when somebody mentions you can use source control even for writing stuff - homework for students, annual reports, books... You have to include even more editors...

I have no clue how to start with version control, how to incorporate it in my workflow, if I need server or what.

Edit

From all your answers (thank you), I get the feeling it's really only something like "synced folders with history" (in the most obvious way). If yes, can you answer two questions? (numbered 4. and 5., so it wont mix up in answers)

4., what if I decide to completely change structure of my program (for ex. in flex, I decide to use two as3 class instead for MXML components) - won't it make confusion?

5., From other questions, how often do I commit? (found this question posted and probably answered, lost it again however)

Edit 2

Again, more answers (thank you).

6., My question 4 was more like if I accidentally (or not) renew some deleted files (which is probably possible), and it will break my program, because for example it depends on other deleted file, which was not undelete, will I be able to get it?

Next, I will (for anyone looking for I was looking for and stumbling upon this question):

Read these questions:

  • Using Source Control
  • What version-control system is most trivial to set up and use for toy projects?

Watch this video:

http://excess.org/article/2008/07/ogre-git-tutorial/

While understanding the basics from manuals, I narrowed it down to subversion(+TortoiseSVN) and git(hub), which are most used and most favorited. Only problem I now have with GitHub is that private repository is paid, so I will either look fro different git solution or look more into Subversion.

Edit 3

Tried Mercurial, but found it not OK for my workflow... now trying Subversion, so I marked oldest Subversion answer.

like image 457
Adam Kiss Avatar asked Jan 14 '10 13:01

Adam Kiss


3 Answers

I'm going to go against the current grain and say go with Git. It's what I did, rather than learning SVN. Read through the first bit of the git book.

Once you've got the hang of it, it's really straightforward to use. Want to start a new repository in the current directory?

git init

Want to commit everything with a short commit message?

git commit -am 'My commit message here'

It's really not rocket science, as some would have you believe.

And for a lone developer, it's really straightforward. You don't have to bother with a separate repo, the repo is in your working directory.

Edit: You also asked about github. They have really idiot-proof guides to getting started. When you sign up for an account and add a new repository, they give you the exact commands needed to sync it up with your local repo. That's another good reason to use the command line.

Why use github? If your computer blows up, there's a copy in the cloud. If you want to collaborate with a friend, send them a link and they can pull from github - v. straightforward.

Edit2:

4: This won't cause any problems.

5: I can't speak for SVN, but from everything I've heard, because git makes it so easy to commit, you can commit a lot more often, which gives you more granular control over your history. So, say you make a massive error, that breaks everything, and you made it some time a week ago, you can go through your git log and work out where the change happened and fix it. As for actual frequency, I commit about once per half hour (once per pomodoro really), but if there are a lot of changes happening, maybe more often.

like image 88
Skilldrick Avatar answered Nov 16 '22 09:11

Skilldrick


  1. Yes you need to have version control.

  2. I suggest you install Subversion on your PC (whatever o/s you have installed). If you are working on windows also get TortoiseSVN, it's the best client for Subversion. The Subversion server runs just fine on a PC.

  3. Download and read the Subversion manual. One of the early chapters provides answers to a lot of your questions, not all of them too biased in favour of Subversion.

Yes, there are other VC systems available, but for the lone learner I thoroughly recommend Subversion+TortoiseSVN.

HTH

Mark

like image 30
High Performance Mark Avatar answered Nov 16 '22 11:11

High Performance Mark


  1. Yes, of course.
  2. Start with Subversion and the TortoiseSVN client. It's got excellent support, great tools and is generally far more straighforward to configure and use than Git is.

There's an excellent Subversion manual available for free.

like image 3
Wim Avatar answered Nov 16 '22 09:11

Wim