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 firstname.lastname@example.org <<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.
Generating SSH key
$> ssh-keygen -t rsa –C “email@example.com” << 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
Authenticate your local machine to push your code to GitHub.com
|$> ssh –T firstname.lastname@example.org
$> git push –u origin master /* Now it will work and upload your code to Github.com */
That’s it Now you can also contribute your code to open source. Show your coding ability to the world through GitHub. Feel free to comment below. If you have any doubt in following these steps feel free to send a mail to email@example.com