4/29/2023 0 Comments Git add all![]() I’d mark a line with a - to be removed, but in most text editors that inserts a -, it doesn’t overwrite the space that was there before. One thing that tripped me up quite often was that I forgot the one character indent. Edit again?” so often, you’ll start to hate yourself for your inability to figure this out, even though it seems so easy (or Git because it can’t figure out what you want). If you’ve never done this before, Git will tell you “Your edited hunk does not apply. Since you’ve got the diff open in your favorite text editor (you did configure Git to use your favorite text editor, right?), you can do whatever you want - as long as you make sure the resulting diff applies cleanly.Īnd therein lies the trick. Anything else, and you’ll get errors (there’s no character for a changed line, since those are handled by removing the old line, and adding the changed one as new). The character can either be a space (indicates an unchanged line), a - indicating that the line was removed, or a + indicating that the line was added. The most important thing to keep in mind: The diff is always indented with one character in addition to whatever other indentation is there. Manually editing the hunk is immensely powerful, but also a bit complicated if you’ve never done it before. As promised, it will open the hunk in a text editor and you can edit it to your hearts content ![]() This is probably the most powerful option. This only works if there’s unchanged lines between the changes in the displayed hunk, so this wouldn’t have any effect in the example above ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |