Programming Documentation

logo

Programming Documentation

Search
Light Mode
Contact Us

Contact us

No results for your search.
Sorry, an unexpected error occurred
⚠️
This is an advanced usage of Git and would not be recommended for new users.

Everything related with git can be accomplished using Git CLI(Command Line Interface).


Installation

In order to install Git CLI please follow the documentation provided at https://git-scm.com/downloads


📘
We will use <variable_name> format to show things that you need to provide for yourself.


First Time Setup

If this is your first time using Git CLI you need to configure some parameters.

📘
If you want to hide your email address from other users please follow this external documentation to use GitHub provided email address.
git config --global user.name "<your_usename>"
git config --global user.email "<your_email>"






📘
If you want to provide user.name and user.email only for current repository use below commands after cloning repository to your local machine.
cd <path_to_repository>
git config user.name "<your_username>"
git config user.email "<your_email>"







Optional: Setup SSH

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:

ssh-keygen -t ed25519 -C "<your_email>"






📘
Adding a passphrase is recommended for security reasons.


Using above command with default values will create two files named:


By default it is located under:


🚫
Under no condition share your 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:



Cloning a Repository

In order to clone a repository we will use different URL depending on our preferred protocol(SSH or HTTPS).


📘
You can find these URLs using GitHub website. Above is provided so you can understand the URL better.



After acquiring the URL we will use git clone command using:

git clone <repository_url>






📘
If you want to clone to a path without changing the current working directory you can add <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







TODO

We should add these topics in documentation to provide better coverage on Git CLI.


On This Page