Of all the odd names for software projects, "git" ranks... somewhere in the middle.
March 11, 2012 12:35 PM   Subscribe

Where can I find resources to help me learn the basics of Git so that I can effectively use Octopress to power my static site blog?

I recently decided to switch from Wordpress to Octopress to power my personal blog. I've been able to configure and deploy Octopress using SSH, so I'm basically set in terms of being able to edit and publish my blog. However, I know that in order to get the full Octopress/Jekyll experience, and for the sake of making sure I can recover if I really foul things up, I should be maintaining a remote git repository of my blog source. But I'm a Git newb, and while there's plenty of documentation out there, I'm not sure where to look. Threads about Octopress, or even vanilla Jekyll, on sites like Stack Overflow presume a level of git-fu that I don't have; and the basic guides on sites like Github are equally unilluminating to me.

My impression of what the workflow should look like resembles this, but the details of how I go about doing it are still difficult for me to grasp.

I won't learn this except by doing it myself, though, so I'm eager to be told where I should be looking for guidance, rather than simply asking "how do I do this?"

(Note that I plan to host the private remote repository myself, rather than using a service like Github, if that matters.)

Thanks!
posted by a small part of the world to Computers & Internet (8 answers total) 23 users marked this as a favorite
 
Best answer: As a Git noob I've found the Git Magic articles helpful. Some more Git links (courtesy coxn on #mefi a few days ago).

Also, there's absolutely no need to "host" a remote repository for what you want to do. Just use git locally on the webserver with no origin, and back up using another method. This is one of the major advantages that Git has over a centralized VCS like Subversion. If you really want to back up using Git, you can simply "pull" the repo from the webserver using ssh.
posted by neckro23 at 12:49 PM on March 11, 2012 [1 favorite]


Best answer: Yuor workflow link doesn't work for me (403 Permission Denied), so I'm not sure what you're looking for.

I haven't moved to Octopress though I've thought about it or something like it. My notion of the best way to use it would be to have one copy of the repository on my local machine, where I mostly make edits and mess around with the site; when I like what I see, I commit and push to the webhost's repository and make it visible to the world. If I want to make a simple change I can edit it on the webhost and commit to that repository, and rely on git to keep my changes from stomping on each other (presumably I would pull those changes from the webhosts' repository back to my local machine's repository at some point and do any necessary merging).

I agree there's no need to use github or other centralized thirdparty repository unless you're trying to collaborate with a bunch of people.
posted by hattifattener at 1:13 PM on March 11, 2012


This is all you need for learning git: Pro Git.
posted by hariya at 1:22 PM on March 11, 2012 [2 favorites]


Response by poster: Thanks hariya!

hattifattener, the image I linked to is the first image on this page. The workflow you describe sounds simpler and safer for me, though.

However -- and this relates to neckro23's answer (thanks for the links, they seem to be on the level I need), it seems to me that I *would* want to have a separate repository for the blog's source if, for example, a major Octopress revision came down the pipe -- wouldn't I lose my site (locally, if not on the webhost) if I tried to upgrade? (Or am I just revealing the depth of my unfamiliarity with Git?)
posted by a small part of the world at 1:26 PM on March 11, 2012


As far as docs go I found the official git tutorial, and other official docs to be adequate.

Do you use other version control systems? I use SVN in my day to day work, so by using git-svn as a front-end for SVN I was able to learn the basics of git.
posted by Joe Chip at 1:41 PM on March 11, 2012


Best answer: I really like Pro Git. Also, good choice with Octopress; I've recently moved my blog to that platform and I've been really happy so far. I use rsync to deploy though, I haven't bothered set up the git hooks necessary.

If you just want a local git repo on your machine, without pushing it to any remote server, just do a 'git init' in your working directory and commit & branch your little heart out. I love git so much I pretty mush use the local workflow absolutely everywhere (even for non-code things!), just so I know i can back out if I decide I don't like my changes.
posted by cgg at 2:06 PM on March 11, 2012 [1 favorite]


Best answer: I read Getting Good With Git as an introduction. I didn't get the screencasts, but if I was struggling after the book, I probably would have.

Other useful links:

The Perfect Workflow with Git, GitHub, and SSH (video + article)

Let's Suck at GitHub Together (video)

Getting off FTP and onto Git Deployment with Beanstalk (video)

help.github.com

I had good luck googling my webhost name + git, and getting how-to guides and the like.
posted by backwards guitar at 3:12 PM on March 11, 2012


Response by poster: Thanks to everyone who has answered so far.

I am in fact using rsync to deploy, but the official Octopress documentation suggests that I should still be using git as well.

The overall impression that I'm getting though, is that I can use git as little or as much as I like with my blog source. I suppose the next step is just try various configs and workflows out and see what works for me. Thanks!
posted by a small part of the world at 4:32 PM on March 11, 2012


« Older What does a Canadian expat moving to Chicago need...   |   Kid-friendly MMO? Newer »
This thread is closed to new comments.