I have created a new repository on github for a project, cloned it and pushed 2 files: README.md and main.c.
But for some reason every time I try to use
git status
or
git add .
to commit changes, I get the following message
# On branch master
nothing to commit (working directory clean)
So I can't push anything and the only workaround solution that works is
rm -rf .git
git init
git remote add origin <repo>
and force pushing the files. After I push the changes it goes back to the 'nothing to commit' message,so I have to reinitialise every time I want to commit.
This problem occurs even when I try to reclone the repository.
I've looked around for solutions, it seems that .gitignore can sometimes cause similar issues but I don't have a .gitignore file in the repo.