https://github.com/theekshana-nirmal/learn-git
This is a quick reference to Git! Maintained by three contributors, weβre adding sections and refining content to make version control simple for all developers. Explore, learn, and contribute! π
https://github.com/theekshana-nirmal/learn-git
git github learning
Last synced: 2 months ago
JSON representation
This is a quick reference to Git! Maintained by three contributors, weβre adding sections and refining content to make version control simple for all developers. Explore, learn, and contribute! π
- Host: GitHub
- URL: https://github.com/theekshana-nirmal/learn-git
- Owner: theekshana-nirmal
- Created: 2025-06-11T08:30:45.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-15T19:20:26.000Z (about 1 year ago)
- Last Synced: 2025-06-27T03:52:55.490Z (about 1 year ago)
- Topics: git, github, learning
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π Git Cheatsheet: Master Version Control with Ease! π
Welcome to the **Ultimate Git Cheatsheet**! Whether you're a beginner or a seasoned developer, this concise guide will help you navigate Git commands like a pro. From initializing repositories to managing branches and collaborating with teams, we've got you covered. Let's dive into the world of version control! π
---
## π Table of Contents
- [π Git Cheatsheet: Master Version Control with Ease! π](#-git-cheatsheet-master-version-control-with-ease-)
- [π Table of Contents](#-table-of-contents)
- [π± Getting Started](#-getting-started)
- [π Basic Commands](#-basic-commands)
- [πΏ Branching \& Merging](#-branching--merging)
---
## π± Getting Started
Set up your Git environment and start tracking your projects.
- **Install Git**: Download and install from [git-scm.com](https://git-scm.com/).
- **Configure Git**:
```bash
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
```
- **Initialize a Repository**:
```bash
git init
```
- **Clone a Repository**:
```bash
git clone
```
---
## π Basic Commands
Manage your files and commits with these essential commands.
- **Check Status**:
```bash
git status
```
- **Add Files**:
```bash
git add # Add specific file
git add . # Add all changes
```
- **Commit Changes**:
```bash
git commit -m "Your commit message"
```
- **View Commit History**:
```bash
git log
```
---
## πΏ Branching & Merging
Work on features or fixes without affecting the main codebase.
- **Create a Branch**:
```bash
git branch
```
- **Switch to a Branch**:
```bash
git checkout
```
- **Create and Switch to a Branch**:
```bash
git checkout -b
```
- **Merge a Branch**:
```bash
git checkout main
git merge
```
- **Delete a Branch**:
```bash
git branch -d
```
---
## π€ Collaboration
Push, pull, and collaborate with remote repositories.
- **Add a Remote Repository**:
```bash
git remote add origin
```
- **Push Changes**:
```bash
git push origin
```
- **Pull Changes**:
```bash
git pull origin
```
- **Fetch Changes**:
```bash
git fetch origin
```
---
## π Undoing Changes
Fix mistakes or revert unwanted changes.
- **Unstage Files**:
```bash
git restore --staged
```
- **Discard Changes**:
```bash
git restore
```
- **Amend Last Commit**:
```bash
git commit --amend
```
- **Revert a Commit**:
```bash
git revert
```
- **Reset to Previous State**:
```bash
git reset --hard
```
---
## π¦ Stashing
Temporarily save changes without committing.
- **Stash Changes**:
```bash
git stash
```
- **List Stashes**:
```bash
git stash list
```
- **Apply a Stash**:
```bash
git stash apply
```
- **Drop a Stash**:
```bash
git stash drop
```
---