首页 > 其他 > 详细

清空github仓库,而不是删除重新创建

时间:2021-03-08 14:04:14      阅读:26      评论:0      收藏:0      [点我收藏+]

今天由于想清空github仓库重新来过,后来不知道怎么解决,于是上网找了资料,顺便发个博文

-- Remove the history from

(从中删除历史记录)

rm -rf .git

-- recreate the repos from the current content only

(仅从当前内容重新创建存储库)

git init
git add .
git commit -m "Initial commit"

-- push to the github remote repos ensuring you overwrite history

(推送到你的远程仓库,以确保覆盖您的历史记录)

git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
git push -u --force origin master

来源: https://gist.github.com/stephenhardy/5470814

清空github仓库,而不是删除重新创建

原文:https://www.cnblogs.com/ryan-coder/p/14498619.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!