无法通过Gitbash /命令行将存储库添加到GitHub

时间:2018-05-24 10:57:59

标签: github command-line repository git-bash

当我尝试通过命令行将项目文件夹推送到GitHub时,收到错误消息“

  

致命:不是git存储库(或任何父目录):

.git“将链接粘贴到存储库并输入”git push -u origin master后。“这里发生了什么?

1 个答案:

答案 0 :(得分:0)

If you want to do create fresh one and delete existing one then follow below steps:

Open git bash command prompt 

--remove the history from
rm -rf .git

--recreate the repo
git init
git add .
git commit -m "initial commit"

--push to the github repo
git remote add origin git@github.com<you git loc>
git push -u --force origin master