-
Notifications
You must be signed in to change notification settings - Fork 0
Git Commands
atakemin edited this page Feb 20, 2025
·
1 revision
Git is a powerful version control system that helps developers track changes in their projects. Below is a summary of essential Git commands categorized by their purpose.
| Command | Description |
|---|---|
git config --global user.name "Your Name" |
Sets the global username for Git commits |
git config --global user.email "[email protected]" |
Sets the global email for Git commits |
git config --list |
Displays the current Git configuration |
| Command | Description |
|---|---|
git init |
Initializes a new Git repository |
git clone <repo-url> |
Clones an existing repository |
| Command | Description |
|---|---|
git status |
Shows the status of changes in the working directory |
git add <file> |
Stages a file for commit |
git add . |
Stages all changes |
git commit -m "Your message" |
Commits staged changes with a message |
git commit --amend -m "New message" |
Amends the last commit message |
| Command | Description |
|---|---|
git branch |
Lists all branches |
git branch <branch-name> |
Creates a new branch |
git checkout <branch-name> |
Switches to a different branch |
git checkout -b <branch-name> |
Creates and switches to a new branch |
git merge <branch-name> |
Merges a branch into the current branch |
git rebase <branch-name> |
Reapplies commits on top of another base branch |
| Command | Description |
|---|---|
git remote -v |
Lists remote repositories |
git remote add <name> <url> |
Adds a remote repository |
git push <remote> <branch> |
Pushes local changes to a remote repository |
git pull <remote> <branch> |
Fetches and merges changes from a remote repository |
git fetch <remote> |
Fetches changes from a remote repository without merging |
| Command | Description |
|---|---|
git reset <file> |
Unstages a file |
git reset --hard <commit> |
Resets to a previous commit and discards all changes |
git revert <commit> |
Creates a new commit that undoes a previous commit |
git checkout -- <file> |
Discards changes in a working directory file |
| Command | Description |
|---|---|
git log |
Shows commit history |
git log --oneline |
Shows a concise commit history |
git diff |
Shows changes between commits, branches, or working states |
| Command | Description |
|---|---|
git stash |
Saves uncommitted changes for later |
git stash pop |
Applies the last stashed changes and removes them from stash |
git stash list |
Lists all stashed changes |
| Command | Description |
|---|---|
git tag |
Lists all tags |
git tag -a v1.0 -m "Version 1.0" |
Creates an annotated tag |
git push origin --tags |
Pushes tags to a remote repository |
- Use
git help <command>to get detailed documentation on a specific command. - Use
git aliasto create shortcuts for frequently used commands.
This cheat sheet provides an overview of fundamental Git commands. For more details, refer to the official Git documentation.
- Lab1
- Lab 1 Meeting Notes
- Lab2
- Lab 2 Meeting Notes
- Lab3
- Lab 3 Meeting Notes
- Lab4
- Lab4 Meeting Notes
- Lab5
- Lab5 Meeting Notes
- Lab 5: MVP Implementation & Planning
- Lab6
- Lab6 Meeting Notes
- Lab7
- Lab7 Meeting Notes
- Lab 7: Milestone 2 Demo Preparation
- Lab8
- Lab8 Meeting Notes
- Lab 8: Requirements Review & Acceptance Planning
- Ahmet's Bio
- Barathan's Bio
- Berkay's Bio
- Berke's Bio
- Caglar's Bio
- Mehmet Emin's Bio
- Nilsu's Bio
- Ömer's Bio
- Selman's Bio
- Taha's Bio
Ahmet Okta
Barathan Aslan
Berke Kartal
Mehmet Çağlar Kurt
Mehmet Emin Atak
Muhammet Berkay Keskin
Mustafa Taha Söylemez
Nilsu Tüysüz
Selman Akman
Ömer Faruk Bayram
- Use Case Diagram
- Class Diagram
- Sequence Diagrams - Admin Management and Moderator Functions
- Sequence Diagrams - Rewards, Badges and Leaderboard System
- Sequence Diagrams - Notification System
- Sequence Diagrams - Tips and Recommendations
- Sequence Diagrams - Challenge and Activity Tracking
- Sequence Diagrams - Waste Tracking and Scoring System
- Sequence Diagrams - User and Account Management
- Sequence Diagrams - Goal Management
- Sequence Diagrams - Authentication
- Sequence Diagrams - Session Management
- Sequence Diagrams - Events Management
- Project Plan
- Requirements
- Elicitation Questions & Answers
- Scenario #1
- Scenario #2
- Scenario #3
- Scenario #4
- Scenario #5
- Scenario #6
- Scenario #7
- Scenario #8
- Scenario #9
- Scenario #10
- Scenario #11
- Scenario #12
- Scenario #13
- Scenario #14
- Use Case Diagram
- Class Diagram
- Sequence Diagrams - Admin Management and Moderator Functions
- Sequence Diagrams - Rewards,Badges and Leaderboard System
- Sequence Diagrams - Notification System
- Sequence Diagrams - Tips and Recommendations
- Sequence Diagrams - Challenge and Activity Tracking
- Sequence Diagrams - Waste Tracking and Scoring System
- Sequence Diagrams - User and Account Management
- Sequence Diagrams - Goal Management
- Sequence Diagrams - Auth
- Sequence Diagrams - Session Management
- User Manual for Frontend-Web
- System Manual for Frontend-Web
- Research Documentation for Frontend-Web
- Testing Manual for Frontend-Web