github - 通过 Gitbash/命令行将存储库添加到 GitHub 时遇到问题
问题描述
当我尝试GitHub
通过命令行将项目文件夹推送到时,我收到错误消息“
致命的:不是 git 存储库(或任何父目录):
.git”,然后我将链接粘贴到存储库并输入“ git push -u origin master
。”这里发生了什么?
解决方案
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
推荐阅读
- python - 从 FFT 数据创建波形数据?
- python - 使用 python 从 hive 读取数据时的性能问题
- python - 如何优雅地从字符串中删除长度为 n 的椭圆(NLP with spacy)?
- ruby-on-rails - 堆栈级别太深 (SystemStackError) 动作包
- c# - 使抽象方法可用于子类
- integration - Splunk 与 Hadoop 的集成
- android - 在低于 6.0 的 android 上获取 READ_CONTACTS 的 SercurityException
- java - Java程序在所有行中添加双引号
- java - Android 设备可以通过 USB 使用来自 Linux 板的摄像头、蓝牙、GPS 吗?
- r - ggplot2:draw_panel 的返回值