Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Mastering Git: A Curated List of Must-Know Commands for Efficient Version Control

Here's a detailed summary of common Git commands, compiled with hands-on examples and descriptions to help you understand and use Git effectively in your development workflow. Git: Essential Commands and Usage Guide Git is a…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Here's a detailed summary of common Git commands, compiled with hands-on examples and descriptions to help you understand and use Git effectively in your development workflow.









Git: Essential Commands and Usage Guide



Git is a powerful version control system used by developers to manage and track changes in their codebase. Below is a compilation of common Git commands along with practical examples and step-by-step descriptions.






1. Initializing a Repository



Command:




git init






Description:

Initializes a new Git repository in the current directory. This creates a .git directory where Git stores all its tracking data.



Example:




mkdir my-project
cd my-project
git init






Explanation:




  1. Create a new directory for your project.

  2. Navigate into the directory.

  3. Initialize a Git repository in this directory.






2. Cloning a Repository



Command:




git clone <repository_url>






Description:

Creates a copy of an existing Git repository. This command clones the repository from a remote server to your local machine.



Example:




git clone https://github.com/user/repo.git






Explanation:




  1. Provide the URL of the remote repository.

  2. Git copies all the files and commits from the remote repository to your local machine.






3. Checking Repository Status



Command:




git status






Description:

Displays the state of the working directory and staging area. It shows changes that have been staged, changes that are not staged, and files that are not being tracked.



Example:




git status






Explanation:




  1. Run the command to see which files have been modified, added, or deleted.






4. Adding Changes to Staging Area



Command:




git add <file>






Description:

Adds changes in the specified file to the staging area. This prepares the file for the next commit.



Example:




git add index.php






Explanation:




  1. Use this command to stage changes in index.php for committing.



To add all changes:




git add .









5. Committing Changes



Command:




git commit -m "Commit message"






Description:

Records the changes made to the files in the repository along with a commit message describing the changes.



Example:




git commit -m "Add user login functionality"






Explanation:




  1. Stage the changes first.

  2. Commit the staged changes with a descriptive message.






6. Viewing Commit History



Command:




git log






Description:

Shows the commit history of the repository, including commit IDs, author names, dates, and commit messages.



Example:




git log






Explanation:




  1. Run this command to review the history of commits made to the repository.






7. Creating a New Branch



Command:




git branch <branch_name>






Description:

Creates a new branch in the repository. Branches allow you to work on different features or bug fixes simultaneously.



Example:




git branch feature-branch






Explanation:




  1. Create a new branch called feature-branch.






8. Switching Branches



Command:




git checkout <branch_name>






Description:

Switches to the specified branch. This command updates your working directory to reflect the state of the branch you switch to.



Example:




git checkout feature-branch






Explanation:




  1. Switch to the feature-branch to work on it.



Note: In Git versions 2.23 and later, you can use:




git switch <branch_name>









9. Merging Branches



Command:




git merge <branch_name>






Description:

Merges the specified branch into the current branch. This integrates changes from one branch into another.



Example:




git checkout main
git merge feature-branch






Explanation:




  1. Switch to the branch you want to merge changes into (e.g., main).

  2. Merge the changes from feature-branch into main.






10. Pushing Changes to Remote Repository



Command:




git push origin <branch_name>






Description:

Uploads the local branch and its commits to the remote repository.



Example:




git push origin feature-branch






Explanation:




  1. Push the feature-branch to the remote repository.






11. Pulling Changes from Remote Repository



Command:




git pull






Description:

Fetches and integrates changes from the remote repository into your current branch.



Example:




git pull






Explanation:




  1. Update your local branch with changes from the remote repository.






12. Removing Files from Staging Area



Command:




git reset <file>






Description:

Unstages the specified file, but keeps the changes in the working directory.



Example:




git reset index.php






Explanation:




  1. Unstage index.php if it was added to the staging area but you don't want to commit it yet.






13. Deleting a Branch



Command:




git branch -d <branch_name>






Description:

Deletes the specified branch from the local repository. Use -D to force delete.



Example:




git branch -d feature-branch






Explanation:




  1. Delete feature-branch after it has been merged or is no longer needed.






14. Stashing Changes



Command:




git stash






Description:

Temporarily saves changes in a stash so you can work on something else. Apply the stash later with git stash apply.



Example:




git stash






Explanation:




  1. Save your changes temporarily if you need to switch tasks.






15. Viewing Stash List



Command:




git stash list






Description:

Displays a list of all stashed changes.



Example:




git stash list






Explanation:




  1. Check the list of stashed changes to decide which to apply or drop.






16. Applying Stashed Changes



Command:




git stash apply






Description:

Applies the most recent stash to your working directory.



Example:




git stash apply






Explanation:




  1. Retrieve your stashed changes and apply them back to your working directory.






17. Removing a Stash



Command:




git stash drop






Description:

Removes a specific stash from the list of stashed changes.



Example:




git stash drop stash@{0}






Explanation:




  1. Remove the specified stash from the stash list.






18. Reverting a Commit



Command:




git revert <commit_id>






Description:

Creates a new commit that undoes the changes from a specified commit.



Example:




git revert a1b2c3d






Explanation:




  1. Create a new commit that undoes the changes introduced by a1b2c3d.









Conclusion



Understanding and using these common Git commands will help you manage your codebase effectively and collaborate efficiently with others. This guide provides a solid foundation for working with Git in your development projects. Feel free to adapt and expand these commands based on your specific workflow and requirements.

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Remote Code Execution (RCE) Defense
Syntax validiert (0 Fehler)
title: Detect Exploitation - Mastering Git: A Curated List of Must-Know Commands for Efficient Version Control
id: 52ec5b26-16b9-4557-a561-2347048a8a05
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-25
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-25"
        description = "YARA Signature for "
    strings:
        $str = "Mastering Git: A Curated List " ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Mastering Git A Curated List of Must-Kno")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Mastering Git A Curated List of Must-Kno*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Mastering Git A Curated List of Must-Kno"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Mastering Git: A Curated List of Must-Kn.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Mastering Git: A Curated List of Must-Know Commands for Efficient Version Control

Thematisch verwandte Begriffe: Mastering, Curated, List, MustKnow · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-61525 | Zammad is a web based open source helpdesk/customer support system. In 7…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag