Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git not committing staged changes

Tags:

git

After deleting / modifying files, I staged them by doing git add -A, and I also tried git add -u after. When I commit the changes I notice that git doesn't actually commit any of the changes. Git status still shows that the files are staged, and doing a git push tells me everything is up to date.

What can be the possible causes of this? Git status clearly shows the deletions and modifications.

Exact commands used:

git add -A

git status - shows all changes are staged as expected

git commit -m 'message here'

nothing gets committed so I tried git add -u

committed again with the same command, still nothing. Here is the output of git status after staging the files:

enter image description here

like image 892
kag359six Avatar asked Nov 07 '22 20:11

kag359six


1 Answers

Have you tried using the specific name of the files or directory? I always use git add . or git add ../something.txt and I've never had an issue. I've only gotten funny business on git with changing branches.

If that still doesn't work, I'd try making a new local repo.

Hope this helps.

like image 118
Rafael Pereira Avatar answered Nov 15 '22 05:11

Rafael Pereira