🕵️ SicherheitslückenCVE-2026-65017 | Apache Airflow Config API information disclosure(17.09.2026 um 05:49 Uhr)
🕵️ SicherheitslückenCVE-2026-67587 | Apache Airflow deserialization(17.09.2026 um 05:49 Uhr)
🕵️ SicherheitslückenCVE-2026-54183 | Apache Airflow information disclosure (EUVD-2026-57310)(17.09.2026 um 05:49 Uhr)
🕵️ SicherheitslückenCVE-2026-59242 | Apache Airflow XCom deserialize endpoint deserialization(17.09.2026 um 05:49 Uhr)
🕵️ SicherheitslückenCVE-2026-67260 | Apache Airflow Scheduler next_kwargs deserialization(17.09.2026 um 05:49 Uhr)
🕵️ SicherheitslückenCVE-2026-65017 | Apache Airflow Config API information disclosure(17.09.2026 um 05:49 Uhr)
🕵️ SicherheitslückenCVE-2026-67587 | Apache Airflow deserialization(17.09.2026 um 05:49 Uhr)
🕵️ SicherheitslückenCVE-2026-54183 | Apache Airflow information disclosure (EUVD-2026-57310)(17.09.2026 um 05:49 Uhr)
🕵️ SicherheitslückenCVE-2026-59242 | Apache Airflow XCom deserialize endpoint deserialization(17.09.2026 um 05:49 Uhr)
🕵️ SicherheitslückenCVE-2026-67260 | Apache Airflow Scheduler next_kwargs deserialization(17.09.2026 um 05:49 Uhr)
🔧 Programmierung 🕛 vor 2 Jahren 6 Min Lesezeit
0

The Essential Git Cheat Sheet: Master Version Control Like a Pro

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Git is an indispensable tool for developers, enabling you to track changes, collaborate with others, and manage your codebase efficiently. This cheat sheet covers essential Git commands that every developer should know, along with some advanced commands for more complex tasks.






1. Setting Up Your Git Repository






Initialize a New Repository






CODE
git init






This command initializes a new Git repository in your project folder. Use it when starting a new project or to begin tracking an existing one.






Clone an Existing Repository






CODE
git clone <repository-url>






Clone an existing repository from a remote source like GitHub or Bitbucket. This is useful for contributing to a project or using an open-source library.






2. Configuring Git






Set Your Username






CODE
git config --global user.name "Your Name"






Sets your username for all Git repositories on your system.






Set Your Email






CODE
git config --global user.email "[email protected]"






Sets your email address for commits.






View Your Configuration






CODE
git config --list






Lists all the Git configurations currently set.






3. Working with Your Repository






Checking the Status of Your Repository






CODE
git status






Displays the state of your working directory and staging area, showing which changes have been staged, which haven’t, and which files aren’t being tracked by Git.






Viewing a Log of Commits






CODE
git log






Shows a detailed history of commits, including author, date, and commit message.






Adding Changes to the Staging Area






CODE
git add <file-name>






Stages specific files for a commit. To stage all changes, use:




CODE
git add .









Committing Changes






CODE
git commit -m "Your commit message"






Commits the staged changes with a descriptive message. It’s good practice to write meaningful commit messages.






Commit All Changes Directly






CODE
git commit -am "Your commit message"






Stages and commits all tracked files in one step. This command does not include untracked files.






Viewing Changes






CODE
git diff






Shows the changes between your working directory and the staging area. Useful for reviewing what you've modified before committing.






Viewing a Specific File’s Changes






CODE
git diff <file-name>






Displays the changes made to a specific file.






Removing Files






CODE
git rm <file-name>






Removes a file from your working directory and stages the deletion.






Moving/Renaming Files






CODE
git mv <old-file-name> <new-file-name>






Moves or renames a file and stages the change.






4. Branching and Merging






Create a New Branch






CODE
git branch <branch-name>






Creates a new branch. Branches are used to develop features or fixes in isolation from the main codebase.






List All Branches






CODE
git branch






Lists all branches in your repository, highlighting the current branch.






Switch to a Branch






CODE
git checkout <branch-name>






Switches to the specified branch.






Create and Switch to a New Branch






CODE
git checkout -b <branch-name>






Creates a new branch and immediately switches to it.






Merge Branches






CODE
git merge <branch-name>






Merges changes from the specified branch into your current branch. This is typically used to integrate a feature branch into the main branch.






Delete a Branch






CODE
git branch -d <branch-name>






Deletes a branch that has been merged. Use -D to force-delete a branch that hasn't been merged.






Rebase Branches






CODE
git rebase <branch-name>






Rebases the current branch onto the specified branch. Rebasing can lead to a cleaner project history but should be used with caution, especially with shared branches.






5. Working with Remotes






Adding a Remote Repository






CODE
git remote add origin <repository-url>






Connects your local repository to a remote server, typically a repository on GitHub, GitLab, or Bitbucket.






Viewing Remote Repositories






CODE
git remote -v






Lists all remotes and their URLs.






Pushing Changes to Remote






CODE
git push origin <branch-name>






Pushes your commits to the remote repository. If it’s your first push, you might need to set the upstream branch:




CODE
git push --set-upstream origin <branch-name>









Pulling Changes from Remote






CODE
git pull






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






Fetching Changes from Remote






CODE
git fetch






Downloads objects and refs from another repository. Unlike git pull, git fetch does not merge changes into your local branch automatically.






Removing a Remote Repository






CODE
git remote remove <remote-name>






Removes a remote from your repository.






6. Undoing Changes






Unstage Changes






CODE
git reset <file-name>






Removes changes from the staging area but leaves them in your working directory.






Discard Unstaged Changes






CODE
git checkout -- <file-name>






Reverts unstaged changes in your working directory to the last commit.






Revert a Commit






CODE
git revert <commit-hash>






Creates a new commit that undoes changes from a previous commit without altering the project history.






Reset to a Previous Commit






CODE
git reset --hard <commit-hash>






Rolls back your project to a specific commit, discarding all changes made after that point. Warning: This is irreversible.






Stash Changes






CODE
git stash






Temporarily saves changes that you don’t want to commit yet, allowing you to work on something else.






Apply Stashed Changes






CODE
git stash apply






Reapplies the most recently stashed changes to your working directory.






Drop a Stash






CODE
git stash drop






Removes a specific stash from your list of saved changes.






7. Advanced Git Commands






Cherry-Pick a Commit






CODE
git cherry-pick <commit-hash>






Applies the changes from a specific commit to your current branch.






Squash Commits






CODE
git rebase -i HEAD~n






Combines multiple commits into one. Replace n with the number of commits you want to squash.






View Commit History as a Graph






CODE
git log --graph --oneline --all






Displays the commit history in a graph format, showing branches and merges.






Cleaning Up Untracked Files






CODE
git clean -f






Deletes untracked files from your working directory. Add -d to remove directories and -n to perform a dry run.






Conclusion



This cheat sheet covers a broad range of Git commands that will help you manage your projects efficiently. Whether you're committing changes, branching, merging, or working with remote repositories, mastering these commands will make you more effective as a developer. Keep practicing, and these commands will soon become second nature.



If you found this helpful, don’t forget to bookmark this post so you can come back to it later when you're wondering what command you should use. Also, please share it with your fellow developers so they can use it too!



Now if you really found it helpful, check out my where I’m active daily!



Happy coding!

Vollständiger Original-Artikel
Den kompletten Beitrag mit allen Details direkt auf dev.to lesen.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
UPDATE: DFN-CERT-2026-4860 rsync: Mehrere Schwachstellen ermöglichen u. a. das ...
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten The Essential Git Cheat Sheet: Master Version Control Like a Pro

Thematisch verwandte Begriffe: Essential, Cheat, Sheet, Master · 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 ...