How to install and setup Git for the first time

This article will help you to install and setup Git on Ubuntu for the first time. The same process can also be used to setup git on Windows and on Macintosh. On Windows you may need to install Git Bash to use Git and follow below process. This will also solve the problem of "permission denied (publickey) git clone" error message.
First to install git type in following command
 "sudo apt-get install git" and then yes for the question asked.
Then type in "ssh -T, if you see Hi username! You've successfully authenticated, but GitHub does not
# provide shell access. Then you are good to go without doing anything below, if not then follow all instructions below.
  1. cd ~/.ssh 
  2. ls to check whether already keys exists or not. If there is no any file names id_rsa or If these files exist then go to 3 or else 2. 
  3. ssh-keygen -t rsa -C "your_email@example.comThis will create these two files for you. Remember "your_email@example.comis your git registered email address only.
  4. Hit "Enter" for how many times it will ask you something over there.
  5. vi to edit this file.
  6. Copy everything in it till the end. End will be with your email id.
  7. Open 
  8. Go to Account settings, it is at the top right corner just besides your user id second icon.
  9. Click on SSH Keys.
  10. Then add SSH key
  11. Give a title and paste that key which we've copied from and click Add key button.
  12. Go to your terminal again and type in this command "ssh -T".
  13. You will definitely get this message  "Hi username! You've successfully authenticated, but GitHub does not
    # provide shell access.". if not you must have missed something. 
  14. Type your issue in comment box I will try to post solution as soon as possible.
  15. If you see above message that means you are ready to use git. 
  16. Play around with it and enjoy Giting. :)

Add new comment