Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On Branch master git status is showing nothing to commit (create/copy files and use "git add" to track)

Tags:

git

github

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.

like image 496
Subhendu Roy Avatar asked Oct 28 '25 11:10

Subhendu Roy


2 Answers

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

like image 182
Nirav Madhani Avatar answered Oct 30 '25 02:10

Nirav Madhani


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.

like image 21
Arthur B. Avatar answered Oct 30 '25 02:10

Arthur B.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!