I want to start to use Git to store some practice projects on GitHub, I used to use Mercurial to store it on google code. I enjoyed using Mercurial Tool, and google code has more generous storage and I think I will still use it as the primary hobby code storage. I use TFS at my workplace. The best tutorial I found online is this three part series, but here is my own summary for my reference in the future.
1. Go To msysgit, and download the installation file, if you are not sure which one to download, then I will suggest using the one which has the most download count.
2. After installing, start GitBash (which runs inside minGW environment), and the first thing which needs to be done is to create SSH keys with the following command “ssh-keygen –C ‘your@mail.com’ –t rsa” . This will generate two keys inside the .ssh directory , and you need paste the public key into your SSH Public Keys inside your account.
If these files are already generated on the other computer, they can be copied over instead of being regenerated.
3. Do some initial configuration, use git config – - globla , I only configured three variables: name, emailaddress, and .gitingore file. Those commands are
$ git config --global user.name "Tekkub"
$ git config --global user.email tekkub@gmail.com
$ git config --global core.excludesfile tekkub@gmail.com
There are a lot of other commands, but those are enough to help me started.
4. Now, you can navigate to the folder you want to add to the github. use the following commands reference on this page.
$git init [This will initialize the direcotry]
$git add. [This will add the the files under the current folder]
$git commit –m ‘commit message’ [This will commit the changes]
$git remote add origin ******(replace the *** with the url on github)
$git push origin master