I would like to commit but, whenever I am entering git commit -a -m "Initial commit. Added a gitignore file and a README file.
Git status showing as Nothing to commit ((create/copy files and use "git add" to track)
Git init
git add .
git commit -----------------
Where am I lacking? Thanks in advance.
If in someone's case even after using git add . this problem persists, then this may be useful.
For people like me working on python, if you are creating virtual environment using
virtualenv .
in the same folder, then it will automatically modify .gitignore file and hence it will look like:
# created by virtualenv automatically
*
Which is may be the source of problem in many cases. Removing * may solve problem.
Conclusion: Try checking your .gitignore file
You have to commit a file ! If you try too commit a repository you'll have this error :"nothing to commit (create/copy files and use "git add" to track)" too. If you want to create a empty repository you have to create a file.gitkeep in your repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With