Tag Archives: git

Fun Tool To Learn More About Git Branching And Merging

Want to learn more about how to work with branches in git? Confused about what “git rebase” does? By way of a post on Google+ I learned about this great tutorial site at: http://pcottle.github.io/learnGitBranching/

Learn git branching

You can step through a whole series of guided lessons (type “levels”) that walk you through all different aspects of using git – or you can type “sandbox” and go into a private area to play. All from the comfort of your own web browser.

More information (and the source code) can be found on Github at https://github.com/pcottle/learnGitBranching. There is a neat aspect of this where people can (and I guess have) contribute additional tutorial levels.

Very cool tool!

Contrasting Mercurial vs Git: Two Opposing Blog Posts

GitvsmercurialWhich should you use for a distributed version control system (DVCS) – git or mercurial? That was the question taken up recently by two opposing blog posts on Atlassian’s blog:

Admittedly this is a bit of a “religious” issue with adherents on either side being extremely passionate about the topic. In my own case, my writing here (as well as my Github account) definitely show that I fall down on the side of git… but I’m also always interested to learning more about the various tools.

The two blog posts are written by passionate advocates for each tool and so naturally have that flavor. Regardless, they make for interesting reading. I don’t see myself switching to Mercurial any time soon… but it’s interesting to see the pros and cons of each. We still don’t have the “perfect” tool… but will we ever?

Given that I started working with version control systems back when RCS was the only option I had… and then CVS was a huge step forward… and then SVN was viewed as excellent… all I can say is that we’ve come a loooonnngg way and it’s greatto see both git and mercurial out there.

P.S. I should note that both of these articles are part of Atlassian’s “DVCS Guide” that has some other useful pieces about why distributed version control systems are worth investigating and using.

O’Reilly Offers 50% Off On Git Ebook And Videos Through Feb 8th

Being a huge fan of the git version control system, I was pleased to see that O’Reilly is offering 50% off on their git-related videos and ebook. I haven’t seen the videos, but the “Version Control with Git” book is quite good. More info on O’Reilly’s site:

Oreilly git offer

P.S. I have no financial motivation to post this info, i.e. I am not being compensated through any kind of referral links or anything else. I just think this is an interesting offer to folks interested in learning more about git.

New Github for Mac 1.1 Release Nov 23rd…

GitHubforMac

I just noticed yesterday that a new version of Github for Mac was released on November 23rd. The blog post about the 1.1 release highlights the major changes as:

  • The “Changes” view has been completely redesigned.
  • The ability from the GUI to commit individual lines of code.
  • A “Commit & Sync” feature so that you have just one step to get your code on Github (or wherever it is hosted).
  • Full screen support for Lion.
  • Tracking repositories if they are moved or renamed.

I’ve gone ahead and downloaded Mac for Github 1.1 and am looking forward to seeing how it works.

P.S. And yes, being perhaps old-skool, I mostly use the command line to work with git. But there are times when a GUI is nice, particularly when looking at changes between versions.

Amusing Video Tutorial: Let’s Suck at Github Together

If you want to learn more about using git and Github, or are a fan/user of git/Github (as I am) and want to pass along a video tutorial for others to see, you may enjoy this episode from Chris Coyier entitled “CSS-Tricks #101: Let’s Suck at GitHub Together“. As you can tell from the title, Chris doesn’t mind poking some fun at his own abilities – and his own aversion to the command-line and preference for GUI utilities.

For me personally, I’m rather “old skool” and typically prefer the command-line, but I appreciate that many people don’t… and I enjoyed Chris’ entertaining episode. Sure, as some commenters noted, there were a few minor inaccuracies/faults… but overall it did the job well in helping introduce people to what git and Github together can do. I can’t embed the video here, but if you click on the image below you’ll be taken to his site where you can view the episode…

Csstricks github video

And if you are over on Github, you can follow me there as github.com/danyork.

Want To Help Guide Git’s Development? Take the 2011 Git Users’s Survey!

Git logoDo you use the git version control system? If so, do you wish it worked a bit differently? Or did you find it hard to use in some way? If you don’t, did you try to start using it and found it difficult to understand?

If you are a git user in any way (or are trying to be), the Git community is LOOKING FOR YOUR INPUT in the Git User’s Survey 2011 at the address:

http://tinyurl.com/GitSurvey2011

As the main page of the Git community wiki asks:

Please devote a few minutes of your time to fill out the simple questionnaire; it’ll help the Git community understand your needs, what you like about Git (and what you don’t), and overall help us improve it.

The survey runs from now through October 3rd and the results will be posted on the Git wiki.

Being a git fan and user I did complete the survey which, true to the notice, did only take a few minutes to complete. As more of a “casual” user of git in that I use it for a variety of projects but don’t live in it as a full-time developer might, I actually found the survey quite educational in that I found names of a whole number of projects I want to explore.

If you do use git and have a few minutes, the folks behind Git would love your input!

Dulwich – a native python way to access Git repositories

Ever wanted to manipulate Git repositories directly in python? Well, okay… I haven’t really myself, but in writing about Google Code’s support for git yesterday, I noticed that they are using Dulwich, a native python implementation of git. Rather than wrapping command-line git with python scripts, Dulwich is a python module giving you direct access to a git repository. As shown in the Dulwich tutorial, creating a new repo is simply this:

>>> from dulwich.repo import Repo
>>> from os import mkdir
>>> mkdir("myrepo")
>>> repo = Repo.init("myrepo")
>>> repo
<Repo at 'myrepo'>

Once a repo is created (or you connect to an existing repo), you can do what you would do with git at the command line: adding files to the repo, committing files, and changing files.

While I don’t know that I personally will use this… it’s very cool that Dulwich is out there for python programmers who want to interact with git repos. Very cool to see!

Google Code Now Supports Git for Hosted Projects

Being a big fan of Git for version control, I was very pleased to see the announcement last week that projects hosted at Google Code can now use git in addition to subversion and mercurial (see also Google Code’s GitFAQ). I had looked at hosting projects on Google Code in the past, but chose not to specifically because git was not an option. While I personally am quite happy using Github for project hosting, it’s always good to see other services supporting git:

Googlecodeandgit

Way to go, Google Code!

Greg Bayer: How to Move Files From One Git Repo To Another While Preserving History

By way of a Hacker News post, I learned of this great post by Greg Bayer:

Moving Files from one Git Repository to Another, Preserving History

I’ve actually had a couple of cases where I’ve wanted to move some files and keep the history. I couldn’t easily figure it out and opted to just copy the files into the new repo and lose the history. This looks like a workable solution instead. Thanks to Greg Bayer for writing it up.

P.S. a comment to the HN post also mentions this “git-subtree” tool, which does look interesting.

NodeFu – Free Hosting of Your Node.JS Apps In The Cloud!

NodeFu.jpgHave you been experimenting with Node.JS (as I have) and wished you had a place to host your Node.js apps? If so, you may want to check out NodeFu.com, a new hosting service that just launched today.

Created by my friend and co-worker Chris Matthieu out of frustration with not getting invites for some of the other new Node.js hosting services, NodeFu is hosted up in Amazon EC2 and currently offers free hosting of Node.js apps to anyone interested.

Getting Started

As shown on the NodeFu home page, the process of using NodeFu is fairly straightforward. You request a coupon (an invite) via a commandline curl:

curl -X POST -d "email=[email protected]" http://nodefu.com/coupon

When you get an email confirming your invite, you can register an account, provide our ssh public key, etc.

From then on out all deployments happen purely through git commands. You start out by registering a new NodeFu application via another command-line curl command:

curl -X POST -u "testuser:123" -d "appname=myapp&start=hello.js" http://api.nodefu.com/app

NodeFu will respond with some JSON that includes the port number your app will run on and the name of the git repo you will push to. You then just do two git commands:

git remote add nodefu the_url_returned_by_our_api
git push nodefu master

And your NodeFu app will be live at http://appname.nodefu.com. As you work on your app, you just do more commits to your local git repo and then do a “git push nodefu master” when you want to update the live app. Once you push to NodeFu, your app should automagically be updated.

A Very Basic Example

You can see NodeFu in action in a VERY basic form at:

http://dany2.nodefu.com

As I write this post today, that app is literally a super basic “Hello, World” Node.js app. The code is visible up on GitHub at https://github.com/danyork/nodefu-dany2 and hopefully in the next bit I’ll have a chance to turn it into something a bit more involved.

Building Voice and SMS Apps with NodeFu

I’ve also created a Tropo app at http://tropohello.nodefu.com which uses the Tropo WebAPI library for Node.js to return JSON to Tropo.com where you can connect to the app using voice, SMS, IM or Twitter. Right now I only have voice and SMS wired up, but you can try out the app at any of these numbers:

Voice & SMS Messaging: +1-850-462-8472
Skype Voice: +990009369991478810
SIP Voice: sip:[email protected]
INum Voice: +883510001827346

Tropo is providing the voice and SMS connectivity and then communicating with my app running over on NodeFu.com. Pretty cool stuff!

Learning More and Trying It Out

You can just go to NodeFu.com to learn more and ask for an invite. Chris has invited 50 people in so far and plans to be giving out more invites over the next few days. It’s notable that Chris has open-sourced the entire codebase for NodeFu, so anyone else could really just download Chris’ code and set themselves up with their own NodeFu-like site:

https://github.com/chrismatthieu/nodefu

Here’s a video explaining what Chris is trying to do:

Other Options

I should note that Chris isn’t alone in coming up with a service like this. The comments to the Hacker News story about Chris’ site (and also the Mashable story) show a range of other Node.js hosting options, including:

… and a couple of others were listed, too, but they seem to offer other forms of hosted JavaScript versus Node.JS hosting.

The key point of all of this is that for those of us experimenting with Node.JS, this is truly a wonderful time to be trying it out, because we now have so many options before us!