I can't seem to run "git add -e" in either Powershell or Git Bash without getting errors. Here are the file (test3.html) contents in question:
<!DOCTYPE html>
<html>
<head>
<title>test</title>
</head>
<body>
Hello
</body>
</html>
Note that there is a carriage return at the last line.
Now, I run the following commands and receive the respective output from my local git repo:
PS C:\repos\git-test> git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: test3.html
no changes added to commit (use "git add" and/or "git commit -a")
PS C:\repos\git-test> git add -e
unix2dos: converting file C:/repos/git-test/.git/ADD_EDIT.patch to DOS format...
dos2unix: converting file C:/repos/git-test/.git/ADD_EDIT.patch to Unix format...
error: patch failed: test3.html:1
error: test3.html: patch does not apply
And here is what appears after entering the "git add -e" command in notepad:
diff --git a/test3.html b/test3.html
index 1663e8c..03366ee 100644
--- a/test3.html
+++ b/test3.html
@@ -1,8 +1,9 @@
<!DOCTYPE html>
<html>
<head>
- <title></title>
+ <title>test</title>
</head>
- <div>
- </div>
+<body>
+ Hello
+</body>
</html>
There is a carriage return after the last line. The file was originally written with notepad++ in UTF-8 encoding.
As soon as I close notepad, I receive these errors:
error: patch failed: test3.html:1
error: test3.html: patch does not apply
Question: Why am I getting these errors, especially if I haven't changed a thing with ADD_EDIT.patch?
I've tried more complex flows where I would split the changes into separate hunks and decide which changes I wanted to commit. Similar results would occur. And, if I can't get even the most simple flow to work, then what's the point...
My reasoning behind this is to become more acquainted with Git since I'm new to it. I've been reading https://git-scm.com/docs/git-add and have been trying to follow along each option.
Any help, suggestions, or references to other posts that I might have missed are all greatly appreciated.
EDIT:
Here is how my configuration looks like:
PS C:\repos\git-test> git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
user.name=Dash
user.email=some.email.address@gmail.com
core.editor=notepad
core.whitespace=trailing-space,space-before-tab
help.autocorrect=1
color.ui=auto
gpg.program=c:/Program Files (x86)/GNU/GnuPG/gpg2.exe
gui.recentrepo=C:/Users/Dash/repos/public-repo-test
apply.whitespace=fix
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.excludesfile=C:\repos\gitignore_global.txt
remote.origin.url=https://Mister0wl@bitbucket.org/Mister0wl/using-git-with-a-gui.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
apply.whitespace=nowarn