It would be more useful if you can zoom in to your screen, the color of the cursor doesn't see clearly, so I could appreciate better what are you doing.
Thanks for posting. How did you get your git diff to look that way? I assume you are using an alias of some sort, as normally git diffs have a much different look.
Man, WTF :D You don't have to change the "hunk header" to edit the commit, git developers aren't that stupid. Just use the syntax git uses. Don't delete context lines and everything will be fine. (In your "example of apply path error" you deleted one context line: with curly brace)
@jonaskuliesius6802 hunk in this case is basically an instruction on how to change the file to get from previous version to the new version. It must follow some rules: if you add new line, you add "+" at the start of it if you delete existing line, you add "-" at the start of it if you do nothing with existing line, you add " " at the start of it (changing line is basically deleting old version, then adding new version) What he did after 5:05 is he removed line 22 starting with " " from the hunk. You can't do that. As said in comment below the hunk, you could remove "+" lines or you could change "-" lines back to " " lines. Deleting " " line is not correct hunk syntax, so it is only natural that git didn't like that. To delete such a line the correct way would be to change " " at the start of the line to "-", or better, don't touch that line at all and remove line 12 "+}". Changing "hunk header" (line 2) is completely pointless behaviour.
Although I should say that editing hunks was never intended to be a simple way of editing code. If you work with hunks very often, you should find some git GUI that will work with hunks for you.
I rewatch this video every time I forget how to edit hunks. Thanks a lot!
Great explanations, thank you so much.
Very helpful!
I appreciate your detailed explanation, but I cannon see your cursor when you are indicating line 37 6:50
To the point and precise! Thanks
Gold!
It would be more useful if you can zoom in to your screen, the color of the cursor doesn't see clearly, so I could appreciate better what are you doing.
Great tutorial!, do you use any plugin for git diff styling?
Hey there! see github.com/athomasoriginal/dotfiles/blob/master/git/.gitconfig#L14
Thanks for posting. How did you get your git diff to look that way? I assume you are using an alias of some sort, as normally git diffs have a much different look.
Hey there, see github.com/athomasoriginal/dotfiles/blob/master/git/.gitconfig#L14
Nice content but the font is way too small. I had to strain my sight to see what you are doing . Thanks for the video though
Man, WTF :D
You don't have to change the "hunk header" to edit the commit, git developers aren't that stupid.
Just use the syntax git uses. Don't delete context lines and everything will be fine.
(In your "example of apply path error" you deleted one context line: with curly brace)
Could you elaborate?
@jonaskuliesius6802 hunk in this case is basically an instruction on how to change the file to get from previous version to the new version.
It must follow some rules:
if you add new line, you add "+" at the start of it
if you delete existing line, you add "-" at the start of it
if you do nothing with existing line, you add " " at the start of it
(changing line is basically deleting old version, then adding new version)
What he did after 5:05 is he removed line 22 starting with " " from the hunk. You can't do that.
As said in comment below the hunk, you could remove "+" lines or you could change "-" lines back to " " lines.
Deleting " " line is not correct hunk syntax, so it is only natural that git didn't like that. To delete such a line the correct way would be to change " " at the start of the line to "-", or better, don't touch that line at all and remove line 12 "+}".
Changing "hunk header" (line 2) is completely pointless behaviour.
Although I should say that editing hunks was never intended to be a simple way of editing code.
If you work with hunks very often, you should find some git GUI that will work with hunks for you.
@@Дмитрий-т2л4ц ~As said in comment below the hunk, you could remove "+" lines~ and that what he did after 5:05
@@salehrezq so, what's your point?