Git Terminal Documentation

1. Introduction

This documentation covers essential Git commands used in the terminal for version control. Git is a distributed version control system widely used for tracking changes in source code during software development.

2. Git Status

The git status command shows the status of changes as untracked, modified, or staged in your working directory.

git status

This command helps you understand the current state of your repository.

3. Git Add

The git add command stages changes for the next commit. The period (.) indicates all changes in the current directory.

git add .

This command prepares changes to be committed.

4. Git Commit

The git commit command records staged changes with a commit message.

git commit -m "commit message"

This command creates a new commit with the specified message.

5. Git Push

The git push command uploads local commits to a remote repository.

git push

This command synchronizes your local repository with the remote repository.

6. Git Branches

Git branches allow you to work on different parts of your project concurrently. Use the following commands to manage branches.

# Create a new branch
git branch branch_name

# Switch to a branch
git checkout branch_name

# Create and switch to a new branch
git checkout -b new_branch_name

# List all branches
git branch

# Merge changes from one branch to another
git merge branch_name

These commands help you create, switch, list, and merge branches in your Git repository.

Back

SSR vs. CSR

Arrow