The guide to basic Git for absolutely beginer


May 27, 2009
Twitter's a new exciting social media. And guess what, I'm quite active on it. Follow me on Twitter to get the latest links and updates.

another tip »

In my company, we use SVN as our revision system, so I have to use SVN at work everyday. It’s good at a certain level however there are also a lot of limit behind its structure. So I decide to move to Git to see if this system any better.
There are a few reason for my moving:

  • Slow is quite a big problem. We use our own SVN server at work so it’s slow but still fine. But for my personal projects which I have to host in Google, it’s a lot of trouble.
  • A lot of trouble when I try to move folders around… I guess I just didn’t do it properly, but I hope the new system could make things easier.
  • .svn everywhere. It’s absoulutely frustrated for web development. If I want to up the whole project on the server, I need to copy the all .SVN as well which increase the massive up time.
  • People talk about Git too much. As a curious person, I can’t resist to try this new fast system.

First impression, Git’s a little complicated. At least it’s not as easy as SVN. So I guess people like me could use some help with a tutorial for absolutely beginners in Git.

So let’s start

Set up and config

Download and install Git for Windows(msysGit) and tortoiseGit into your computer. Just keep its default setting would be alright.
TortoiseGit is like TortoiseSVN but for Git. I think it’s quite neat to use.

Configuration

After finish install both of the software. Go to Start > All programs > TortoiseGit > Settings
Go to Git > Config
Change your name and email in there.

Register with GitHub

Head to GitHub and get a free account. (Choose Pricing and sign up)

Next step enter all the information. You will be asked to enter the SSH public key. This key is like password in SVN. A way to authenticate you when using Git. You will need to generate it.

Go to: Start/All Programs/Git/Git Gui
Choose Help/Show SSH key. If it hasn’t show you the key, choose Generate Key to get it.
Copy and paste it in to your sign up.
gitkey

Finish register, gitHub will redirect you to your dashboard.
In the Dashboard, choose: Your Repositories (create a new one).
githubcreate
Just type in the information you want.

Ok, after that, it will lead you to a page where guide you though using Git with command. But I prefer using TortoiseGit instead. It’s much easier.

First commit

Go into the folder store your project(You could create a new folder if you want).

Right click and choose Git Create Repository here. It will create a .git folder.
Choose Git Commit -> “Master”. Not like SVN. This commit only work locally. So you still haven’t add anything into the repository yet.

Next, right click > TortoiseGit > Push. This time you actually upload the commit on to the repository.
It will ask you to choose the branch, keep master as default. Destination will need to be point to you GitHub repository. So go to that repository page from github, copy and paste “Your clone URL” into Arbitrary URL. Then Ok.
Now Git will update all the commits the project to the repository.
gitpush

And what about update

Simple, Right click > TortoiseGit > Pull and you get the update

That’s it. Play around and have fun with Git!

  • Delicious

Some more useful articles for you

Under Category: App Development, Web Development
Article Tags: ,
Trackbacks
June 29th, 2009
Leave a Reply