【问题标题】:Importing React Starter Kit website to github将 React Starter Kit 网站导入 github
【发布时间】:2016-04-28 17:29:22
【问题描述】:

我使用 React Starter Kit 编写了一个网站,现在我想将其导入 github。

我尝试使用 github 的说明导入它,但它导入了原始存储库的克隆,其中包含有关先前提交的 cmets。很奇怪。

无论如何,如何将我的新网站导入 github?

谢谢, 瑞恩

【问题讨论】:

  • 如果你想删除提交历史,删除.git文件夹,然后执行git init初始化一个新的repo,然后运行git remote add origin <your-repo-url>添加你的repository URL,然后git push origin master -u推送将本地存储库的内容复制到 GitHub 存储库。
  • 谢谢!我认为这会奏效。我明天早上试试,然后回复。

标签: github react-starter-kit


【解决方案1】:

我必须这样做:

rm -rf .git
git init
git add src docs ... <- rest of stuff you want to commit
git commit -m "first commit"
git remote add origin https://github.com/..
git push -u origin master

这似乎可以解决问题

【讨论】:

  • git add . - 将本地文件中的所有文件(.gitignore 中列出的文件除外)添加到“暂存”区域,以便在您运行 git commit -m "Initial commit" 时包含在提交中
猜你喜欢
  • 1970-01-01
  • 2017-11-08
  • 1970-01-01
  • 2018-05-12
  • 2016-12-27
  • 2017-07-28
  • 1970-01-01
  • 1970-01-01
  • 2017-10-18
相关资源
最近更新 更多