Everything related with git can be accomplished using Git CLI(Command Line Interface).
In order to install Git CLI please follow the documentation provided at https://git-scm.com/downloads
<variable_name>
format to show things that you need to provide for yourself.
If this is your first time using Git CLI you need to configure some parameters.
user.name
The name that will be shown in commit history.user.email
The email that will be shown in commit history.git config --global user.name "<your_usename>"
git config --global user.email "<your_email>"
cd <path_to_repository>
git config user.name "<your_username>"
git config user.email "<your_email>"
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 and personal access token at each visit. You can also use an SSH key to sign commits.
You will first need to create an SSH key using ssh-keygen
command:
-t
Specifies the type of key to create. Recommended value ed25519
-C
Comment to identify key easier(for humans)ssh-keygen -t ed25519 -C "<your_email>"
Using above command with default values will create two files named:
id_ed25519
Private key file to prove identity to remote server.id_ed25519.pub
Public key file that remote server uses to authenticate requests.
By default it is located under:
C:/Users/<your_username/.ssh/
/Users/<your_username>/.ssh/
/home/<your_username>/.ssh/
id_ed25519
file or equivalent. This file must be kept private.
Next we will need to add the id_ed25519.pub
file to your GitHub account:
In order to clone a repository we will use different URL depending on our preferred protocol(SSH or HTTPS).
git:github.com:<organization_name>/<repository_name>.git
https://github.com/<organization_name>/<repository_name>.git
After acquiring the URL we will use git clone
command using:
git clone <repository_url>
<output_path>
directly to the end of the command.An example with output folder parameter
git clone git:github.com/P1Gaming/P1-OM-Info.git /Users/siyahas/output_path
We should add these topics in documentation to provide better coverage on Git CLI.