Wednesday, October 28, 2009

Installing and Setting up Git

I thought this was going to be hard, but between the time I downloaded the OS X installer earlier today and now, I came across Bob's Blog post on Setting up a Mac to Work with Git and GitHub. I've barely had to use my brain! You rock, Bob.

At Bob's "Import an Existing SVN Repository," I didn't have an existing repository--this is my first adventure in version control. I'm listing some steps below that are the alternative to that step.  Once I completed Bob's Step 2, a friendly page was returned by GitHub with information specific to me.  I copied, pasted, and edited the first section of those as described in Bob's "Configure your Mac to Talk to GitHub."  Continuing in that section, I created a public key and gave it to GitHub.  When you're done with that GitHub will tell you "our RSA fingerprint is..."--you will need this in a minute.

Now you can begin to use the commands from second section of the GitHub summary page (or manually type the following) in your terminal window.

mkdir projectname
cd projectname
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin
git push origin master

At this point, you will get a message saying the authenticity of the host can't be established and the value of the RSA fingerprint. It should match the one provided by GitHub when you entered your public key. Once you continue connecting (assuming the fingerprints match), you will get a message telling you what Git has done.

I need to review the Git documentation I've been reading, but I believe that I have matching empty repositories locally and on GitHub at this point.
git status
On branch master
nothing to commit (working directory clean)

I hope that means I'm good to go, but I'm too tired right now to find out more.

No comments:

Post a Comment