I switched from Subversion to Git entirely, shortly after YAPC last year. Now
I only use svn for work and other people's projects, and even that is because
I'm just way too lazy to bother witching to git-svn just yet.
Git is a really great tool, and I have enjoyed using it much more than Subversion. By this, what I really mean is that it's generally gotten in my way a lot less while still providing even more tools for getting real work done. I know that it's all sorts of different under the hood, and I even understand some of them. This article about Git was interesting as lazy reading to get a bit more information about what's going on under the hood.
It's not an introduction to using git, though. I have seen quite a few
introductions to it that look something like this
explanation that Git is all about
content and not metadata. I'm not sure who the intended audience is for this
post, but I hope it isn't "people considering switching to Git."
I see a lot of people saying, "I tried to move to Git, but it was too confusing." I think the confusion must be coming from the hype, and not so much the product. Sure, Git can be really confusing, when you get into its weird features that come from its magical moon code, but it makes a very simple replacement for a lot of CVS or Subversion use cases. The problem is that once you've become part of the Git Mob, you become so excited by true decentralization, content-addressability, and other forms of advanced mtfnpy technologies that you can no longer be bothered to explain how to just check in a damned file change.
Fortunately, I have not yet tried to deal with any of the git commands that
are rated GURPS Tech Level 8 or above, so I still bellyfeel Subversionthink.
Sam Vilain, who is way cool, wrote an introduction to git-svn for Subversion/SVK users, and it's very good, especially at explaining why Git is a good tool. There's also Git's own Git - SVN Crash Course, which isn't bad, but it does some weird things like put tagging and branching under one header (even though in Git they are, as is proper, two distinct things).
My point is this: if you have your own code or documents under source control,
git is a very good tool to consider. It's very, very fast. It's very easy to
use. It comes with a lot of nice tools (like, say, gitk). If that sounds
nice, don't get distracted listening to how it will revolutionize your
conception of source code control by eliminating metadata-based delta-logarithm
concatenation sets. Just run git init and start committing. The two
documents above are decent minimal introductions. Maybe I'll do a lightning
talk on Git For Morons this year.
thoughts on git (Score:1)
I've looked at switching/using git at least twice in the last six months or so. Lately, it seems that native Win32 support is improving so that hurdle I had is dropping.
I get most of it, conceptually, but I find some parts of the application of it confusing. It desperately needs more cookbooks, more examples of "here's how I work with it day to day" and not just by Linux kernel developers who are (a) highly-technical already and (b) managing a vast, decentralized project with their own particular legacy
Re: (Score:1)
I don't know why git commit doesn't have -a as default. I made an alias for "git ci" to "git commit -a" and that's that.
I don't find that I touch config files very often, after my initial setup, which was really not much: set up some aliases, set up my username. Done.
rjbs
Re: (Score:1)
The “
-a” switch is because git has an indirection between the working copy and the repository: the index, ie. a commit-ready snapshot of the tree. You don’t commit the state of the working copy directly; you copy things from the working copy to the index (this is called staging), and then commit the index. If you make a change in the working copy but you do not stage it, a plain commit will not contain the change from the working copy. Explicit staging is done usinggit-add.The “
-aRe: (Score:1)
I suppose I find myself doing something similar with SVK. Small commits to my local repo as I make changes and then pushing the whole thing (often lumped together) up the repository.
--dagolden
Re: (Score:1)
I think I'd be more interested in hearing you (or other git users) expound on whether the -a is a good or bad th
rjbs
Re: (Score:1)
Sorry, but now it’s you making assumptions. When someone who has only ever seen tutorials asks “why the
-a,” I cannot presume that they know git makes a distinction between the working copy and what gets committed. So I can’t talk about its value before laying out the facts, which resulted in two paragraphs of expository prelude.And indeed, judging by David’s reply, he appreciated the tack I
Re: (Score:1)
rjbs
Re: (Score:1)
Hmm. Honestly, I’m not trying to be ornery, I just can’t give a straight good/bad answer. It’s highly dependent on workflows.
In my case, I do “
foo status” quite frequently, and always when I’m poised to “foo commit.”When
fooisgit, thegit-statusis an opportunity togit-addthe files I think I’m done editing during for this particular set of changes. Sometimes while I continue in other files, I go back and make further changes in files I’ve aRe: (Score:1)
I think the (in my experience) underhyped command that I need to use more often for having multiple sets of things changing is git-stash. I should try to use it more.
rjbs
Re: (Score:2)
- ask
-- ask bjoern hansen [askbjoernhansen.com], !try; do();
Re: (Score:2)
I just learned all this today, so take it with a grain of salt, but to me having -a exist and that feature not be the default is exactly how I want to work. I have my working copy, with tons of changes I want to keep around but ignore for the moment, and then I want to go through 25 changed files and build up a list of changes to commit. Then I don't want to botch it all by typing "cvs commit -m'commit message' [oops I forgot to list my files!]" . As a total git newbie, I think this is great design, at l
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
Re: (Score:2)
Git supports a number of different transports, but the simplest way to share is to put a git repository in a publicly accessible web directory (just a plain ordinary web server not a 'git server'). You would typically push to it using git over ssh or by rsyncing your repository directory to the server. Other people would pull from it using git over HTTP. They obviously can't commit directly, but they can send you patches, or they can publish their own repository containing a modified branch and you can
Re: (Score:1)
I think the confusion of novices right now is also because DVCS have only just gone mainstream. In contrast to CVS or Subversion, almost everyone is only just figuring this stuff out, so novices don’t have any firm guidance – we’re all making this up as we go.
hosted git repository cookbook (Score:1)
After complaining about the lack of cookbooks, I should lead by example and try to let others benefit from the time I spent figuring things out.
I'm not sure if this will convert me, but at least it isn't so damn painful to experiment[1] with anymore.
-- dagolden
[1] By "experiment" I mean not just controlling my own files but seeing how I would collaborate with others. Pull, push and all that.