Skip to content

anupdebnath/test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Git Commands Reference Repository

A collection of commonly used Git commands for quick reference.

Repository Operations

# Clone a repository
git clone https://github.com/username/repository.git

# Check status
git status

# Add files
git add filename.ext
git add .  # Add all files

# Commit changes
git commit -m "Commit message"

# Push to remote
git push origin branch-name

# Pull from remote
git pull origin branch-name

SSH Key Generation

ssh-keygen -t ed25519 -C "your_email@example.com"

GPG Key Generation

gpg --gen-key

Branch Management

# List branches
git branch
git branch -a  # List all branches including remote

# Create new branch
git branch new-branch-name

# Switch branches
git checkout branch-name
git switch branch-name  # Newer syntax

# Create and switch to new branch
git checkout -b new-branch-name

History and Logs

# View commit history
git log
git log --oneline
git log --graph --all

# View changes
git diff
git diff --staged

Remote Operations

# List remotes
git remote -v

# Add remote
git remote add origin https://github.com/username/repository.git

# Merge branches
git merge branch-name

Additional Commands

# Show current branch and status
git branch --show-current

# Stash changes
git stash
git stash pop

# Reset to previous commit
git reset --hard commit-hash

# View remote branches
git ls-remote --heads origin

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published