Git and SSH Basics
Introduction to Git Version Control
Git is a distributed version control system designed to track changes in source code during software development. As a critical developer tool, Git enables collaborative repository management and secure coding practices.
Core Git Concepts
Git operates through a series of fundamental operations:
Operation |
Description |
Commit |
Saves project snapshot |
Branch |
Creates independent line of development |
Merge |
Combines different development lines |
Push |
Uploads local repository changes |
Pull |
Downloads remote repository changes |
SSH Protocol Fundamentals
SSH (Secure Shell) provides encrypted network communication for secure remote access and data transfer.
graph LR
A[Local Machine] -->|SSH Connection| B[Remote Server]
B -->|Authentication| C[SSH Key Verification]
Installation and Configuration
To install Git and SSH on Ubuntu 22.04, use the following commands:
## Update package lists
sudo apt update
## Install Git
sudo apt install git
## Install OpenSSH
sudo apt install openssh-client openssh-server
## Verify Git installation
git --version
## Verify SSH installation
ssh -V
Basic Git Repository Setup
## Create new directory
mkdir my_project
cd my_project
## Initialize Git repository
git init
## Configure user information
git config --global user.name "Your Name"
git config --global user.email "[email protected]"