What is Git and GitHub? Basically it is an online code sharing community that uses repositories to maintain code versions.
What will u need to do?
- Set up a free account on the GitHub social network and a repository
- Download and install Source Code Management tool
- Link the two together
Set up a free account
- Go to http://github.com and select “Pricing and Signup”
- Click “Sign Up” in the Open Source table
- Fill in the registration form (leave SSH Public Key blank)
Setting up a repository
So there should only be one code repository per project. If a repository DOESN’T exist u can create one. However, if it DOES exist then you have to fork it.
FORK: By forking a project instead of cloning, creating a new GitHub repo, and pushing to it, you allow us to create a link between your fork and the original. This link helps us keep you informed of changes to the original codebase and make it trivial for you to notify the originator of changes that you have made and would like have reviewed.
For the purpose of my setup, I will be forking an existing processing.js repository
- If u are not logged in (to GitHub), log in. This will bring u to the home page, if not click on the GitHub Social Coding logo on the upper left corner of the page.
- Click on “Find a Repository”
- Type “processing.js” in the search textbox (don’t change any defaults) and press enter
- Select the “jeresig/processing-js” Repository
- Select the “fork” button (found beside the repository name)
Download and install Source Code Management tool
- Download the latest version from Google Code. Run the executable
- Press “Next” for most of the configuration except for the following screens:
- Once Setup is complete, you can generate your SSH key. Open up the msysgit cmd: Start=> Search for “Quick Launch” folder => right click => Select “Git Bash Here”
- The command window should open up. Type ssh-keygen -C “youremailinquotes@com” -t rsa to create a key. Here is another tutorial on SSH Keygen.
Note: You do not need to put in any input after the ssh-keygen command, just press enter after every prompt.
- Identify yourself on Git using these two commands:
- git config –global user.name “yournameinquotes”
- git config –global user.email youremail@com
- Tell GitHub apps about u. Log into GitHub, select “Account” (top right corner), select “Global Git Config”. Copy and paste the commands in the pop-up into the Git Bash command prompt.
Link the two together
- Add SSH key you just created into GitHub. Open SSH key in a text editor. Looking back at the ssh-keygen command, you identified “C:\Users\YourNameHere\.ssh\” as the path. Open this folder (it might be hidden). Open id_rsa.pub in a text editor and copy its entire contents.
- Go back to your GitHub Account and just under the “Global Git Config” we used 2 steps above u will find the “SSH Public Key” Section. Click “Add a Key” and paste the SSH key into the “Key” textarea. DO NOT include any extra spaces. You can leave the “Title” blank if u wish. Don’t forget to press “Add Key”
- Test to make sure that everything works. On the Git Bash command prompt type the following command: ssh email@example.com I got a connection confirmation prompt and I had to type yes.
- Get the actual code in the Repository using this Git Command: git clone git://github.com/annasob/processing-js.git processing
- To get the path of ur repository: Log into GitHub. On the homepage click on the Repository you want to clone. Once the repository information comes up look for “Public Clone URL” or “Your Clone Url”