This article will tell you how to install and config git.
For the latest stable version for your release of Debian/Ubuntu.
$ apt-get install git -y
If it is installed successfully ,you use command
git --version and you will see the version.
If you pass the –global option ,you need to do this only once because then Git will always use that information for anything you do on that system.
If you want to override this with a different name or email address for specific projects, you can run the command without the –global option when you’re in that project.
$ git config --global user.name "John Doe"
Now you can configure the default text editor that will be used when Git needs you to type in a message.
If not configured, Git uses your system’s default editor.
If you want to use a different text editor, such as Emacs, you can do the following:
$ git config --global core.editor emacs
If you want to check your configuration settings, you can use the git config –list command to list all the settings Git can find at that point:
$ git config --list
You can also check what Git thinks a specific key’s value is by typing git config
$ git config user.name
Using the SSH protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to GitHub without supplying your username or password at each visit.
By default, the filenames of the public keys are one of the following:
$ ls -al ~/.ssh
Open Terminal ,and paste the text below, substituting in your GitHub email address.
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
Your ssh file is saved as ~/.ssh/filename.pub ,such as id_rsa.pub.
You can open your ssh file ,and copy the text to your clipboard.
In the “Title” field, add a descriptive label for the new key.
Paste your key into the “Key” field.
Open Terminal ,and paste the text below.
$ ssh -T [email protected]
If your SSH connection is ok ,you will see a message like this:
Hi username! You've successfully authenticated, but GitHub does not