I am trying to commit a file called "index.html" using git but git is committing just a empty file without any insertions even after I make sure the file have changes, this is the terminal command that I've run
PS C:\Users\m00n\Desktop\projects> mkdir Git-project
PS C:\Users\m00n\Desktop\projects> cd Git-project
PS C:\Users\m00n\Desktop\projects\Git-project> git init
Initialized empty Git repository in C:/Users/m00n/Desktop/projects/Git-project/.git/
PS C:\Users\m00n\Desktop\projects\Git-project> git status
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
index.html
nothing added to commit but untracked files present (use "git add" to track)
PS C:\Users\m00n\Desktop\projects\Git-project> git add index.html
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: index.html
PS C:\Users\m00n\Desktop\projects\Git-project> git commit -m "committing index.html"
[master (root-commit) 0a7e832] committing index.html
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 index.html
first creating directory called "Git-project", then entering it and initializing a git repository, then creating a file called "index.html" from the file explorar, then writing some code to the file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>search</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<a id="searchlink" href="index.html" class="active">Text search</a>
<a id="imagelink" href="image.html">Images search</a>
<a id="advansedlink" href="advansed.html">Advansed search</a>
</header>
<form action="https://www.google.com/search">
<div>
<input type="text" name="q" id="textInput">
</div>
<input type="submit" value="Google Search" id="submitBtn">
</form>
</body>
</html>
for example, then making sure the file exist by running "git status", then staging the file by running "git add index.html" and running "git status" again to make sure the file is there and is ready to by committed, and finaly committing the file, the problem is in the commit message there is 1 file but 0 insertions, which means git has committed just an empty file, I've tried to make a repository on github and then connecting to it and running the code, but the problem is the same, after I push all the commits to github, I see just an empty file, I don't know why?
git statusfor the first commit, but omitted it for the second commit and only described what you saw. Show it literally!