3

Now I make every time a zip file of all my files to make backups. But then I heard about svn und later I read that git is "better" than svn. Can someone suggest me with which I should start learning?

why
  • 1,275
  • 4
  • 12
  • 23
  • 7
    neither is for "backups" they are version control systems, that need to be backed up as well –  Jun 23 '10 at 16:43
  • Can you better define your environment and goals? It sounds like you are a solo developer and you are working on small projects. Are your "backups" actual backups that you copy to a different location in case a disk crashes OR are they actually used as versions?? For example, "This ZIP file is from yesterday when I was working on Feature X". – Freiheit Jun 23 '10 at 16:45
  • On a side note - if you are considering a DVCS, `Mercurial` is almost as good as Git (though some people would take offense at that claim :-)) and has a better Windows UI. Of course, "better" is just in comparison to Git. :-) – Franci Penov Jun 23 '10 at 17:02
  • 1
    mercurial is pure python, git is a combination of c and unix tools. because of that, mercurial _can_ be slower (you have to be doing something pretty intense to notice though), but it is way easier to install on windows. if you aren't using windows, the difference is in philosophy: git tries to offer the most power and flexibility possible, hg is more conservative, and limits itself to commands that don't change history. It is also more straight forward if you are comming from an svn background (which doesn't matter in this case, any command set will be equally foreign) – Matt Briggs Jun 23 '10 at 17:57
  • @Matt Briggs: I just don't buy the "way easier to install" argument. You can download the msys git installer, run it, 'next, next, next' through the install wizard and you're done. If you've never used a unix shell before, then there's certainly a learning curve to using the command line tools, but I don't see how the install experience could be much easier. – CB Bailey Jun 23 '10 at 21:44
  • Does this answer your question? [Should I use SVN or Git?](https://stackoverflow.com/questions/161541/should-i-use-svn-or-git) – starball Nov 12 '22 at 01:15

10 Answers10

12

Neither is "better" than the other; both serve different needs. Subversion is a centralized system; Git is distributed. In Subversion, there is one (and only one) server that everybody reads from and writes to; in Git, each developer has their own repository, and changes are shared by pushing and pulling between these.

If these are your personal files, I recommend to use Git. There is no central server, so it is easier to get started. That being said, Git has a somewhat steeper learning curve, and there are no really good graphical clients; in Windows, as in *nix, you're best off using the command line version.

Thomas
  • 174,939
  • 50
  • 355
  • 478
  • Thats why I wrote better in apostrophes. – why Jun 23 '10 at 16:43
  • Except GIT on Windows is a bit of advanced rocket science. And GIT's user interface is the worst nightmare of the UX designers. :-) – Franci Penov Jun 23 '10 at 16:44
  • git on windows: http://code.google.com/p/msysgit/ . and there is a great git UI: GitX on OSX. – Jason Jun 23 '10 at 16:52
  • git is better period. you can easily work with it the same way as svn, only it is better technology. – Matt Briggs Jun 23 '10 at 16:58
  • @Jason - " No worry, this is easier than you think. Downloading and executing it will give you a working development environment and compile Git automatically!" - as I said, advanced rocket science. and the Windows GUI for Git is terrible. No, it's goddamn awful. It's a frightening sight; a nightmare coming to eat your brains. But it's getting better... :-) – Franci Penov Jun 23 '10 at 17:00
  • @Matt Brigs - "Git is a Harrier Jump Jet. And not in a good way" (http://reprog.wordpress.com/2010/05/10/git-is-a-harrier-jump-jet-and-not-in-a-good-way/) :-) – Franci Penov Jun 23 '10 at 17:04
  • 4
    @Franci - Git doesn't even need to be 'installed' on windows anymore as msysgit have a portable version. It took no more effort or time to get working on windows than linux. If downloading and unzipping are rocket science I need to update my business card. – mfperzel Jun 23 '10 at 17:07
  • 3
    @mfperzel - :-) steps to using portable msysGit: 1) download it; 2) figure out what .7z is; 3) find, download and install 7zip; 4) extract; 5) open cmd, add git to path; 6) git init, git add, git commit; 7) curse, set EDITOR=notepad.exe; 8) git commit again; 9) curse again, set EDITOR to devenv.com; 10) git commit again; 11) curse again as git does not understand spaces in paths; 12) git commit -m; 13) curse again; do git commit --amend --author='Franci Penov ' as per git message; 14) curse again as git won't accept name with space; ... 35) give up and use TortoiseSVN – Franci Penov Jun 23 '10 at 17:23
  • @franci: 1) you can't assume git works like svn. Git works like modern SCM systems, SVN works like the previous generation. If you do not know modern SCM systems, that will be an additional thing to wrap your head around 2) git is a very powerful tool. you need to spend some time learning it. if something more straight forward is your cup of tea, try hg (just realize, it doesn't do as much). 3) if you are still developing on windows, git relies heavily on standard unix tools, so hg may be more appropriate for your circumstances. – Matt Briggs Jun 23 '10 at 17:47
  • 1
    to install for me: step 1) open a command prompt. step 2) type "sudo apt-get install git-core". step 3) profit! – Matt Briggs Jun 23 '10 at 17:48
  • @Matt Briggs - exactly what I've been trying to convey - **Git is not the best option for someone that just starts with version control**. (whether it is _the best_ version control is a separate topic... :-)) – Franci Penov Jun 23 '10 at 18:07
  • 1
    i disagree. the only reason that it is more difficult is if someone has to unlearn the way svn works. if you start thinking about branches and changesets from the beginning, I don't think its really any "harder", its just different. where git gets harder is the more advanced stuff, but its not like that stuff is easier with other tools, generally it is impossible. – Matt Briggs Jun 23 '10 at 18:16
  • @Matt Brigs - branches and changesets _are_ the advanced stuff. (rocket science is also not hard, if you start thinking about space flight physics, jet propulsion and advanced composite materials from the beginning... :-)) – Franci Penov Jun 23 '10 at 18:33
  • @Matt Briggs - btw, I am a bit confused by your previous comments. either "you can easily work with it the same way as svn" or "you can't assume git works like svn", but for sure it can't be both, right? :-) – Franci Penov Jun 23 '10 at 18:40
  • Ok, so if we are talking about svn checkout/commit/revert vs git clone/commit/push/checkout, git would probably be nominally harder. that being said, if you are a professional, you shouldn't be shying away from learning a tool cause it is a little bit harder. immediately, you will get significant speed improvements and better auto-merging with git. down the road, you will do stuff that is so far beyond svn that you will wonder how anyone could use something like that in this day and age. svn is infrastructure, git actually helps you work. – Matt Briggs Jun 23 '10 at 18:44
  • by "the same way as svn" i mean having a central server on the network that everyone pushes to and pulls from, as opposed to a distributed open source way (which git is really designed for). – Matt Briggs Jun 23 '10 at 18:45
  • @Matt Brigs - "you can use Git same way as svn" is like saying "you can use C++ same way as C#" and then clarifying "and by that I mean it doesn't have garbage collection and you have full control over memory management, but you can still create executables with it" – Franci Penov Jun 23 '10 at 19:43
  • @Franci: see my comments below (http://stackoverflow.com/questions/3103637/start-with-git-or-svn/3103667#3103667): Git and SVN being fundamentally different, it is interesting to realize there is more to "version control" than branches emulated as directories, and incredibly complicated `mergeinfo` properties all over the place. And a DVCS will introduce an orthogonal dimension to branching (push/pull) which is good to know (for complex publication workflow as well as simple backup purpose) – VonC Jun 23 '10 at 20:04
  • @Franci - Remember, with SVN you must have a server to use it. Which instantly makes it just as, or more, complicated than git to install. With all the steps you typed it takes 10 minutes to have a repository created and to begin using it. If you are unable to follow almost every beginner git tutorial and neglect to set your name you arn't going to have any luck using SVN either. The UI of Git might be a reason for a beginner to not use Git,(Use Mercurial instead if this is the case), but installation on windows is absolutley not one. – mfperzel Jun 23 '10 at 20:34
  • @VonC - Yes, I absolutely agree that learning both Git and SVN can be quite useful. I just think Git is not the right one to start with, mostly due to its complexity (which is the price to pay for its power, of course). – Franci Penov Jun 23 '10 at 20:35
  • @mfperzel - no, you don't have to have a server for SVN, you can use it with a local (as in on your own machine) repo. :-) – Franci Penov Jun 23 '10 at 20:38
  • @mfperzel - "The commands of Git might be a reason for a beginner to not use Git" - exactly what I've been trying to say all along. Git is probably the most powerful source control tool, but is way too complex for beginners and offers horrible user experience, especially on Windows. – Franci Penov Jun 23 '10 at 20:41
  • @Franci - I'm arguing specifically that it is not anymore "horrible" on windows than it is on Linux. It might have been bad on windows at one point, but it just isn't anymore. About using Git as a beginner, I think it provides so many common sense features that are extremely useful and really I've never liked SVN. I personally would recommend Git even to someone inexperienced with VCSs. If you can program you can learn to use Git. It is no where near as diffcult as some people claim. On the other hand, I do stand totally corrected about using SVN locally. – mfperzel Jun 23 '10 at 21:33
1

start from svn, it's concept is easier. then go with git, it's much more powerful.

Jason
  • 807
  • 5
  • 15
  • 3
    If you're going to go to git, I wouldn't start with svn. If you're only just starting to learn VCS concepts it will only hinder the learning process to switch tools in the process and svn and git have a very different view on things. – CB Bailey Jun 23 '10 at 16:45
  • git is different from svn, but not that much in my opinion. otherwise we won't have a git-svn bridge... – Jason Jun 23 '10 at 16:49
  • 2
    @Jason: Clearly there is an *enormous* difference between distributed and centralized VCS. – Cascabel Jun 23 '10 at 16:57
  • @Jason: I second Jefromi's comment: see http://stackoverflow.com/questions/161541/svn-vs-git/2549128#2549128. They are *fundamentally* different. – VonC Jun 23 '10 at 17:00
  • @nusbit is asking about where to start. To start with a VCS, he need to learn the basic concepts: checkout(pull), checkin(push), branch, merge. svn and git are the same at this concept level, or they won't be both called "VCS". Distributed/centralized is a choice of technical implementation, not the concept. – Jason Jun 23 '10 at 17:06
  • @Jason, well, about that merge thingy. SVN does it file-by-file and poorly, Git merge at the full tree level and seamlessly. Both are merges, but Git will offer a better experience. And DVCS is not just an "implementation", but it introduces the new **concept** of publication (orthogonal to branching). See http://stackoverflow.com/questions/2563836/sell-me-distributed-revision-control/2563917#2563917 – VonC Jun 23 '10 at 17:15
  • @VonC, thx for the links. I admit DVCS has a lot of evolution than the centralized VCS. But please forget all those fancy words for a while, let's think about their basic user requirements: version control. – Jason Jun 23 '10 at 17:33
  • @Jason: com'on. You can keep thinking about a bike (SVN) and a car (Git) as both tools fulfilling the same basic requirements (accelerate, brake, turn), but if you imagine one second that you can do "the same thing" with both vehicle, you are (imho) mistaken. Actually certain massive repositories (with lots of files and binaries) could only be managed with SVN. And some complex merge workflow will only be managed with Git. Limiting oneself to the "basic requirements" and getting to the conclusion you can use one or the other tool is not seeing the full picture. – VonC Jun 23 '10 at 17:49
1

I personally recommend git - it's easy to work with, and you can mess with things without affecting the copy on the server. You can easily branch stuff off, and a server isn't even needed. If you do need a server, there's github, or you can just use any server with SSH. I never managed to grasp the workflow of SVN.. I'd recommend reading through http://whygitisbetterthanx.com/#svn/ too.

edef
  • 743
  • 4
  • 13
0

By all means, use something. Just having .zip files is asking for disaster.

If you've never used source control before, use SVN, since it's easier to grok for newbies. Once you've gotten the hang of it (or are working on a big team), you may want to switch to git or another distributed version control system.

JSBձոգչ
  • 40,684
  • 18
  • 101
  • 169
0

Compared to making zip-file snapshots of code, both git and svn ( or Mercurial or even cvs) can dramatically improve your coding workflow. I'd suggest reading about what the differences are between the different version-control philosophies out there and pick based on how you code and who you need to share with (if anyone).

David Harks
  • 730
  • 4
  • 5
0

You can start with easygit you'll get the simplicity of svn with the power of git!

Bauna
  • 649
  • 1
  • 5
  • 6
0

Learn both! Otherwise you will never value the advantages of a distributed system such as git.

Git will be just slightly harder, but on the long term you will appreciate much more over SVN, specially when branching. If you want to understand that you will have to learn with both. Sooner or later you will have to deal with both of them since they are so popular

I would start with git because probably it will be the one that you will stick to. And the transition to svn will be easier than the other way around (you will have to adapt to the limitations, not learning new concepts)

SystematicFrank
  • 16,555
  • 7
  • 56
  • 102
0

Either option is much, much better than using zip backups. Personally I think that if you're learning from scratch i'd just go with one of the popular distributed systems - Git or Mercurial. I've not used Mercurial but the the more I use Git the more i'm glad I switched from SVN.

It used to be the case that you could only use Git on Windows with Cygwin, but it's perfectly fine these days thanks to Msysgit. TortoiseGit is also a decent GUI interface although once you've gotten a handle on things you'll find yourself doing most things on the command-line anyway.

Also, although Git does have a bit more of a learning curve to it than SVN, its distributed nature makes it very easy to get started with (just cd into a directory and type 'git init' and you're good to go).

The ProGit book by Apress is also available online and a decent reference.

richeym
  • 4,049
  • 3
  • 24
  • 23
0
  • If you plan on working anywhere that does programming, chances are high that they will use SVN. You'll need to learn it at some point.
  • I would personally recommend learning Mercurial at some point, because it's the bee's knees. In my opinion it combines the best parts of SVN with some good concepts from git.
Ender
  • 27,153
  • 7
  • 30
  • 34
-2

If you are looking for something easy to deploy, have a look at fossil. It is a distributed versioning system like git, but consists only of a single executable. It provides a distributed wiki, ticket system, versioning, all in a self-contained web-server.

Your repository will also be a single file (a sqlite database).

http://www.fossil-scm.org

relet
  • 6,819
  • 2
  • 33
  • 41