Haben Sie versucht,
git branch -D -- --track
? die "--
" ist in der Regel die Konvention für "was keine Option folgt, ist, was auch immer der Name"
Von "The Art of Unix Programming", Abschnitt "Command-Line Options":
It is also conventional to recognize a double hyphen as a signal to stop option interpretation and treat all following arguments literally.
Sie diese Konvention finden in anderen (nicht notwendig, Unix-ähnlichen) CLI (Command Line Interface) wie cleartool:
If a nonoption argument begins with a hyphen (–
) character, you may need to precede it with a double-hyphen argument, to prevent it from being interpreted as an option:
cleartool rmtype -lbtype -- -temporary_label-
Der P18 (ein schneller und flexible Datei-Präprozessor mit Makro-Verarbeitungsfunktionen und spezieller Unterstützung für die Internationalisierung) erwähnt, dass auch und gibt eine gute Beschreibung der allgemeinen Idee hinter dieser Konvention:
All option arguments passed to the commands start with a single hyphen.
All option arguments (if any) must precede all non-option arguments.
The end of the option arguments may be signaled using a double hyphen, this is useful if a non-option argument starts with a hyphen. Terminating the list of option arguments with a double hyphen works for all commands, even those that don't take any option arguments.
Das OptionParser Werkzeug geschrieben in Rubin legt es auch ganz deutlich aus: *
Option Parsing Termination
It is convention that a double hyphen is a signal to stop option interpretation and to read the remaining statements on the command line literally. So, a command such as:
app -- -x -y -z
will not ‘see’ the three mode-flags. Instead, they will be treated as arguments to the application:
#args = ["-x", "-y", "-z"]
Hinweis: Manchmal dauert es drei Striche und nicht zwei, vor allem, wenn die CLI folgt streng den Gnu Optionen Stile:
The Gnu style command line options provide support for option words (or keywords), yet still maintain compatibility with the Unix style options.
The options in this style are sometimes referred to as long_options
and the Unix style options as short_options
.
The compatibility is maintained by preceding the long_options with two dashes
Similar to the Unix style double-hyphen ’ --
’, the Gnu style has a triple-hyphen ’ ---
’ to signal that option parsing be halted and to treat the remaining text as arguments (that is, read literally from the command line)
Also ... wenn '--
' ist nicht genug (es sollte mit Git-Befehle sein), versuchen '---
'
Ich würde gerne wissen, wie Sie diesen Zweig in erster Linie erstellt haben. Es sieht nicht so aus als hättest du "git branch - --track". Oder hast du? –
Hier ist die problematische Linie, ich habe versucht, eine entfernte Niederlassung zu verfolgen. git branch -b --track Herkunft/dev – Felix
Zitate oder Schrägstriche funktionieren nicht, weil sie früher von Ihrer Shell interpretiert werden, während das Problem in Git und seinem Argument liegt. – Kos