Sunday, September 20, 2009

Installing Git version control from windows

This sentence confirms my ownership of the site and this site comply with the Terms and Conditions and program policies for Google AdSense. ca-pub-0819929743481189

  1. Go to http://code.google.com/p/msysgit/downloads/list and download the latest version of git and install it.
  2. Now open the Git bash and generate a ssh key. Type ssh-keygen -C "username@email.com" -t rsa ( When you click on 'Enter' key note where the ssh key is going to be saved"
  3. Now open the file where you have saved ssh key and note it down.
  4. Go to www.github.com
  5. Create your own git hub account. While creating the account you will be asked to enter the ssh key. Copy the saved ssh key.
  6. Now you need to create your own user name and email for the local repository. This will be information incase of multiple users committing the code to know who is the committing the code . Type this with your email and password
    git config –global user.email Your.Email@domain.com
    git config –global user.name “Your Real Name”
  7. Then you are ready to proceed with getting into a project. Copy the “Clone URL” from a github project page. Make a new directory on your machine, to become your working directory. There are two approaches to which project to clone.
  • Clone from your own fork repo. This will make it trivial to push your changes up, but require one more command to get upstream changes.
  • Clone from the upstream (my) repo. This will make it trivial to get change, but require one more command to be able to push changes, because you can’t push to another Github users’ repo.
Now if you have already created a repository in github.com, and want to clone it to your local machine then follow the below steps
  • Go to start --> All programs --> Git --> Git UI
  • A new window will open and click on "Clone Existing Repository"
  • Now it wil ask you to enter source location which will be something like git@github.com:firstnamelastname/yourrepository.git and target directory would be your rails_apps folder/yourappname
  • Click on 'clone'.
  • Incase you get "Permission denied" then type ssh git@github.com and press enter and then you should get a welcome message from git hub. If you have not received then you should do some more research on git.
  • Congratulations! you have successfully cloned a remote repository. Suggestions are welcome incase of errors in this blog.

No comments:

Post a Comment