Troubleshooting misplaced .git directory (nothing to commit)

后端 未结 16 1490
死守一世寂寞
死守一世寂寞 2020-12-05 01:42

I started getting this message. No matter what I edit and try to commit, it says there is nothing to commit. Looks like git does not see my working directory and looking som

16条回答
  •  情深已故
    2020-12-05 02:27

    This must have happened because by mistake you reinitialized git in the same directory. Delete the .git folder using the following command Go to repository you want to upload open the terminal and then use the following commands

    1. remove the .git repository sudo rm -r .git
    2. Now again repeat from initializing git repo using git init
    3. then git commit -m "first commit"
    4. git remote add origin https://github.com/user_name/repo
    5. git push -u origin master After that enter the username and password and you are good to go

提交回复
热议问题