Nach dem Ausführen einer interaktiven Rebase in Git möchte ich eine Commit-Nachricht haben, die mit (Hash oder Pfund) Zeichen beginnt, aber Zeilen beginnend mit werden als Kommentare behandelt und ignoriert.Escape # -Zeichen in interaktiver Rebase-Commit-Nachricht
Gibt es eine Möglichkeit, das Zeichen #
zu entkommen, um meine Commit-Nachricht tatsächlich mit einem #
starten zu lassen?
Details
ich eine interaktive rebase bin Durchführung mit:
git rebase -i HEAD~4
Dann im Editor Ich tue alles, was benötigt wird, zum Beispiel:
pick b010299 #91691 Add test for logging in with valid credentials
reword 5e9159d 91691 Implement log-in feature
pick 2735aa3 #91691 Re-factor logic
pick 14bd500 #91691 Tidy up 'using' declarations
# Rebase 60d6e3f..14bd500 onto 60d6e3f
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
Dann git lädt die Commit-Nachricht in meinem Texteditor für das Commit, das ich umschreiben möchte, aber ich möchte meine Commit-Nachricht mit einemspeichern 10 am Anfang:
#91691 Implement log-in feature
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# rebase in progress; onto 60d6e3f
# You are currently editing a commit while rebasing branch 'master' on '60d6e3f'.
#
# Changes to be committed:
# modified: My.Website.LogInController.cs
Aber das bedeutet, dass meine Commit-Nachricht ignoriert wird. Wie gehe ich vor, um die Übermittlungsnachricht #91691 Implement log-in feature
zu machen?
Was passiert, wenn das i begehen s sehr groß und mehrzeilig, wie kann das hashmark am Anfang der Zeile eingefügt werden? – Mohammed
Fügen Sie einfach Ihre Zeilenumbrüche ein, bevor Sie die Anführungszeichen schließen. Git ist mit mehrzeiligen, langwierigen Commit-Nachrichten zufrieden. –