Latest News

10th May 2010
Send to twitter Send to Facebook

Here's a post to remind me of simple Git procedures. Maybe other people with find this helpful. After using CVS for a decade, it's a bit hard to wrap my head around git, but I'm making that journey.

I'm using github as my repository.

START A NEW PROJECT

mkdir MYPROJECT
cd MYPROJECT
git init
touch README
git add README
git commit -m "first"
git remote add origin git@github.com:/GITHUB_USERNAME/MYPROJECT.git
git push origin master

A git repository URL looks something like this: git@github.com:/taskboy3000/Tester.git

WORK ON AN EXISTING PROJECT

git clone [GITPROJECTURL]

ADD FILES TO LOCAL REPOSITORY

git add [FILE]
git commit -m "My comment about the files I added"

You can also add all the files in your project at once:

git commit -a -m "All files, including tilde files, have been added"

UPDATE REMOTE MASTER WITH LOCAL SANDBOX

git commit -m "Final checkin"
git push origin master

UPDATE LOCAL SANDBOX WITH REMOTE MASTER

git fetch origin
git merge origin master

REVERT LOCAL SANDBOX TO REMOTE MASTER

git reset --hard

This will restore deleted files and overwrite uncommitted changes.

Also see the github book.

Current Status

I do hate to admit that I enjoy working on a Mac. It's really the most pleasant Unix desktop I've used in 15 years.

Posted: Mon May 10 18:32:06 +0000 2010

--Via identi.ca

About this blog

The taskboy blog is a exploration of computer technology by Joe Johnston. Topics of posts include practical examples Perl, PHP, Python and Java as well as book reviews, industry insights and miscellaneous good stuff.