1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 17:22:08 +02:00
tldr/pages.de/common/git-branch.md
Sebastiaan Speck dcb53c85a0
pages*: update outdated pages (#11821)
Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
Co-authored-by: Juri Dispan <juri.dispan@posteo.net>
Co-authored-by: Isaac Vicente <isaacvicentsocial@gmail.com>
2023-12-28 16:48:20 +01:00

1,000 B

git branch

Verwalte und Arbeite mit Git Branches. Weitere Informationen: https://git-scm.com/docs/git-branch.

  • Liste alle Branches auf (Lokal und Remote). Der momentan aktive (ausgecheckte) Branch wird mit * markiert:

git branch --all

  • Liste alle Branches auf, welche einen spezifischen Git-Commit in ihrer Historie enthalten:

git branch --all --contains {{commit_hash}}

  • Zeige den Namen des aktuellen Branches:

git branch --show-current

  • Erstelle einen neuen Branch auf Basis des letzten Commits:

git branch {{branch_name}}

  • Erstelle einen neuen Branch auf Basis eines bestimmten Commits:

git branch {{branch_name}} {{commit_hash}}

  • Benenne einen Branches um (der Branch muss nicht ausgecheckt sein):

git branch -m {{alter_branch_name}} {{neuer_branch_name}}

  • Lösche einen lokalen Branch (der Branch muss nicht ausgecheckt sein):

git branch -d {{branch_name}}

  • Lösche einen remote-Branch:

git push {{remote_name}} --delete {{remote_branch_name}}