GitHub is highly secured and follow ssh-rsa
So we need to setup as ssh public key for our connection, and let github know about it.
take terminal and as user ( not root, usually many of us have a habit of typing sudo su as the first commang at terminal, this time avoid it)
type
ssh-keygen -t rsa -C "[email protected]"
Here,
-t -> tells which encryption
-C ->try to use the same mail id you have given ti github (for ease of memory)
now you will get two files
id_rsa and id_rsa.pub in ~/.ssh/
now copy the whole content in file id_rsa.pub without altering the content of the file.
Now go back to you github account.
go to account settings >>> SSH Public Keys
Add a new Key
and paste the content you copied into field "key" and save (give a title of your choice).
now github know to process the requests from your system.
now try
$ssh [email protected]
thuis must return Hi! UserName
ignore if any error is shown,
but make sure , it shows Hi! UserName
okay! now we are going to set the repositories local copy on ouor machine and reflect changes at the remote system
make a directory ( as user, not root )
mkdir MyProject
cd MyProject
git init
( initialise an empty git repository there, see for a hidden folder .git/ there.)
after creating files in MyProjects, when you feel like adding it to your repository at github, do
git add
now run status and check the files you are going to commit next,
git status
git commit -m "Your comment about this commit"
( this updates .git/ folder in your local repository )
now we tell git about the remote repository to be updated
git remote add origin [email protected]:username/ProjectName
( you remember from where we got this URL, its Your Clone URL )
git push origin master
Hope it will work for you.