In this post I am going to explain about how to setup your Github account and Show your code ability to the world.
What is GitHub?
Github is one of the most important developments in software over the past five year. The site began in 2008 as a simple frontend for the open-source GIT distributed version control tool. It was similar to code repositories like SourceForge, Google Code, or Bitbucket But Github has transcended the category to become an institution in its own right. Features that is pioneered are now crucial tools for any group software engineering work. It is now the world’s largest and most dynamic repository of open-source code, and a strong Github account has become more important than your CV or formal education for the most cutting-edge technology companies.
Click here to open the github website.
Select Free Account:
Select your account type as free. If you are corporate you can select the paid account service.
Create New Repository:
- Click on the Plus symbol
- Select new repository option
- Give your repository name as Sample for test purpose
- Add the description of your repository.
- Select the public option as it is free and it will be visible to everyone
- For private repository you have to select the paid service.
- Click on the create repository button.
- Your repository “Sample” is ready now
Setup the local repository on your machine.
Installing and setting up the GIT repo on your system
|$> sudo apt-get install git-core –y [in ubuntu machine] windows [Download MiniLinux]|
$> mkdir repo
$> cd repo
$> mkdir Sample
$> cd Sample
$> git config –global user.name “Senthilkumar M” << Use your name here >>
$> git config –global user.email email@example.com <<Use your email id here >>
$> git init
$> git add README.md
$> git status
$> git commit –m “Initial commit”
$> git status
$> git remote add origin https://github.com/USERNAME/Sample.git
$> git push –u origin master /*It doesn’t work */
Pushing the local code to Github.com
- Executing git push –u origin master will through an error.
- We need to generate ssh keys so that Github knows that we have access rights
- Run the following commands to generate the SSH keys.
$> ssh-keygen -t rsa –C “firstname.lastname@example.org” << Your Github id here >>
Press enter two times until it generate the key fingerprint
$> cd .ssh
$> cat id_rsa.pub
Update the public key in github site
- Copy the contents of the above file (id_rsa.pub) and paste it to github.com site
- Goto Setting -> ssh keys -> Add new key-> paste the key
- Now go to github.com/settings/ssh
|$> ssh –T email@example.com|
$> git push –u origin master /* Now it will work and upload your code to Github.com */