background preloader

Git

Facebook Twitter

Github

Torvalds. Manual. Git flag of the day --color-words. I use Git not only for code, but also for text, my most common use case being co-authorship of scientific papers typeset in LaTeX. While reviewing other author changes, the usual line-by-line diff is often annoying since: Paragraph re-formatting gets in the way (hello guys accustomed to compulsory Vim's gq or Emacs' M-q): it does not effect the final rendering, but it still hinders peer-review of changes.Even in the simplest case of a single word change on a single line, it will take some time for your eyes to spot where, along the line, the actual change is. Stuff like wdiff does help, but I've never looked at how to integrate it with Git, and I still find it a pain in the eyes due to the fancy ASCII arts used to denote additions and deletions (pain that I usually experience when looking at the output of debdiff).

There are nice diffing GUIs or editor-integrated solutions out there, but what I've always dreamed of is a plain old cmdline geekism. Compiling Git on Snow Leopard. Monday, 31 August 2009 • Permalink These are instructions for compiling and installing Git, a free, fast, and efficient distributed version control system, on Mac OS X 10.6 (Snow Leopard). The benefits of manually building Git yourself in /usr/local are detailed here and here. Prerequisites Before following these instructions, you will need: Mac OS X 10.6 Snow Leopard The latest Xcode Tools (from the Snow Leopard DVD or downloaded from Apple — the 10.5 version won’t work) Confidence running UNIX commands using the Terminal If you want to learn more about UNIX and the command line, check out my PeepCode screencast on this topic. Step 1: Set the PATH Launch Terminal.app from the /Applications/Utilities folder.

We need to set your shell’s PATH variable first. If you’re using TextMate like you should be and have installed the UNIX mate command, then you can create and start editing the file like this: mate ~/.profile To the end of this file, add the following line (or verify that it’s already there): Git Submodules: Adding, Using, Removing, and Updating. I’ve spent a little more than a month working with Git now. I can honestly say that while there are many things that I like about Git, there are just as many things that I personally find to be a pain in the butt. Submodules specifically have managed to be a thorn in my side on many occasions. While the concept of submodules is simple, figuring out how to actually work with them can be a chore. I say “figuring out” because not everything about working with submodules is well documented.

I’ll cover two of the more difficult things to figure out: removing and updating submodules from your repository. What are Submodules? The concept of submodules is brilliant. My profession is working with WordPress themes. Each theme that we produce is kept in its own Git repository. For example, we have a theme called FlexxBold. As I mentioned before, not everything in Git is easy to work with. Adding Submodules to a Git Repository There are three main parts to this command: Using Submodules Closing Thoughts.

Git subtrees. Building your own online transit planner with a bike and a GPS Fellow Navarra member William Lachance has been featured in an awesome article in The Coast about hbus.ca, his new online public transit planner for the city of Halifax. The catch? The Halifax public transit commission doesn't want to have anything to do with it. They've spent over a year and untold amounts of money trying to do it themselves. Now, in my experience, once you've made someone look stupid, as Will has unfortunately done with the transit people in Halifax, they'll get even more defensive. ...in Halifax, that is. iPhone app, anyone? April 2, 2009 19:33 I tried Joel's salary scale method, and the results were... ...mixed. ;) Joel Spolsky recently published an article about the public salary scale system at Fog Creek Software.

At it happens, I've been following Joel since he first wrote about that system back in 2002 or so, and my software company at the time used a salary system modeled after his. And you know what? It's Magit! Calendar about nothing. OGRE Git Tutorial. Posted on 2008-07-13, last modified 2008-08-01. This is a recording of the Git tutorial given by Bart Trojanowski for the Ottawa Group of Ruby Enthusiasts.

The talk was hosted by Jay Lawrence of Infonium. Special thanks to Richard Guy Briggs for help with this recording. UPDATE: Richard has posted photos of the talk I was working with some new equipment for this recording and I'm afraid that the audio suffers from some clipping. I hope to get all the bugs worked out for the next video I post. The videos are also available in Ogg Theora/Vorbis format for downloading (right-click, save as...): [Git the basics Part 1 - 76,473,624] [Git the basics Part 2 - 248,230,749] Tags: Video Git.

Git tricks. The Thing About Git. The thing about Git is that it's oddly liberal with how and when you use it. Version control systems have traditionally required a lot of up-front planning followed by constant interaction to get changes to the right place at the right time and in the right order. And woe unto thee if a rule is broken somewhere along the way, or you change your mind about something, or you just want to fix this one thing real quick before having to commit all the other crap in your working copy. Git is quite different in this regard. You can work on five separate logical changes in your working copy -- without interacting with the VCS at all -- and then build up a series of commits in one fell swoop. Remember a long time ago, at the dinner table, when your kid brother mashed together a bunch of food that really should not have been mashed together -- chicken, jello, gravy, condiments, corn, milk, peas, pudding, all that stuff -- and proceeded to eat it?

The Tangled Working Copy Problem Viva La Index. My Git Workflow. Git’s great! But it’s difficult to learn (it was for me, anyway) – especially the index, which unlike the power-user features, comes up in day-to-day operation. Here’s my path to enlightment, and how I ended up using the index in my particular workflow. There are other workflows, but this one is mine. What this isn’t: a Git tutorial. It doesn’t tell you how to set up git, or use it. I don’t cover branches, or merging, or tags, or blobs. There are dozens of really great articles about Git on the web; here are some. My brief history with Git I started using Git about six months ago, in order to productively subcontract for a company that still uses Perforce. Each of these systems has flaws. Git’s problem is its complexity. Git without the index I got through my first four months of Git by pretending it was Subversion.

. $ cat ~/.gitconfig [alias] ci = commit -a co = checkout st = status -a $ git ci -m 'some changes' Adding Back the Index So what’s the point of the index? Well, probably.