简体   繁体   中英

I have reinstalled Git on my computer . . . and can NOT add files to my new local .git repository

All my JavaScript/Node.js code is working locally on my Windows computer . . . and I wanted to deploy my application to Heroku via Github.

I installed Git, configured Git, added and comitted all my local files to my local .git repository in my local project folder. I also signed up for an account on GitHub, created my first remote repository in that account and pushed all my locally comitted files to GitHub. When I tried to deploy my application to Heroku via GitHub, the application did not show up in Google Chrome.

To fix this I DELETED 'Git' in C:\\Program Files\\Git. I also DELETED my local '.git' repository in my local project folder and my remote repository 'my-app' in my account on GitHub . Then I reinstalled Git, configured name, email, default code editor and recreated the folder '.git' in my local project folder with the command 'git init'.

When I now try to add all my updated local files to my new, clean local '.git' repository with the command 'git add -A', I receive the error : 'my-app' does not have a commit checked out - adding files failed.

The 'my-app' is my old, remote repository on GitHub that I have DELETED. I have created 1 new remote repository on GitHub with the name 'my-new-app'. Otherwise my account on GitHub is totally clean and updated.

Can you help ?

I am using the code editor 'Visual Studio Code' with a bash schell :

User@workstation00 MINGW64 ~/Project (master) $ git add -A

..... error: 'natours-app/' does not have a commit checked out - fatal: adding files failed

Thanks Wolfeius . . . I have SOLVED the problem.

When I deleted the old local '.git' repository in my local project folder a NEW folder with the OLD '.git' inside it was automatically created. I did not notice that . . . so when I tried to add all my updated files to my new, fresh '.git' there were two (2) '.git's in my local project folder . . . and this resulted in the strange error message. :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM