github changes not staged for commit

后端 未结 13 690
[愿得一人]
[愿得一人] 2020-12-23 13:31

I have a very basic github setup with a readme, a directory, and another directory inside it with an html file. On github I can only view the readme and the first folder but

13条回答
  •  北海茫月
    2020-12-23 13:48

    In my case the problem was the subfolder that I was tying to push was a git folder itself

    So I did the following

    1. Go inside the subfolder that you want to push and run this:
    rm -rf .git
    
    1. Then run this:
     git rm --cached 
    
    1. Then come to main project folder and run this (make sure to add / after folder name)
        git add /
        git commit -m "Commit message"
        git push -f origin 
    
    

提交回复
热议问题