All Git command

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now
# Configure Git with user details
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

# Initialize a new Git repository
git init

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

# Check the status of your repository
git status

# Add files to the staging area
git add <file>
git add .  # Add all files

# Commit changes
git commit -m "Commit message"

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

# Push changes to the remote repository
git push origin master

# Pull changes from the remote repository
git pull origin master

# Check the commit history
git log

# 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 <branch_name>

# Merge a branch into the current branch
git merge <branch_name>

# Delete a branch
git branch -d <branch_name>

# Stash changes (temporarily save changes)
git stash
# Apply stashed changes
git stash apply

# Show changes between commits or the working directory and index
git diff

# Show detailed information about a commit
git show <commit>

# Add a tag to a commit
git tag -a v1.0 -m "Version 1.0"

# Push tags to the remote repository
git push origin --tags

# Revert changes
git revert <commit>

# Reset the current HEAD to a specific state
git reset --hard <commit>
Senior Software Development Engineer at Cotocus

Related Posts

Complete GitHub SSH Authentication & Push Guide

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now 1….

Read More

fatal: cannot update the ref ‘HEAD’: unable to append to ‘.git/logs/HEAD’: Permission denied

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Error…

Read More

Git Troubleshooting Advance Guides

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now In…

Read More

Top 10 Git interview Question

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Basic…

Read More

Git all Commands

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now Git…

Read More

How to do git clone without installing git in WSL (Windows Subsystem for Linux)

Limited Time Offer! For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly. Master DevOps, SRE, DevSecOps Skills! Enroll Now In…

Read More
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments