git - 如何撤消现有远程存储库中的 git init --bare
问题描述
我错误地在现有的远程存储库中运行了“git init --bare”。Git 说它重新初始化了现有的 git 存储库。有什么办法可以撤销这个动作?
解决方案
实际上 'git init --bare' 只会将额外的文件添加到您的存储库中。你可以删除它们。
% cd your-repo
% git status
untracked files:
(use "git add <file>..." to include in what will be committed)
HEAD
config
description
hooks/
info/
% git clean -f -d
Removing HEAD
Removing branches/
Removing config
Removing description
Removing hooks/
Removing info/
Removing objects/
Removing refs/
您的目录现在像 'git init' 之前一样干净
推荐阅读
- java - 用于单元测试的模拟弹簧控制器
- spring-batch - org.springframework.dao.EmptyResultDataAccessException:第 0 项(共 10 项)未更新任何行:有人看到此错误吗?
- android - 在 Android Studio 3.4 中更新到 gradle 5.1.1 后无法同步
- kubernetes - 如何为示例 Istio 应用程序公开外部 IP 地址
- haskell - 通过电子邮件发送文件的虚假目标?
- python - 我怎样才能告诉程序只允许某种类型的输入?
- javascript - AngularJS / Webix UI 集成 - HTML 控件不变
- oracle - 将 ColdFusion 8 连接到 Oracle 12c
- rcpp - 如何从 RCPP 调用 model.matrix 或等效项,可能在线程代码中?
- python - pipenv install 每次都安装依赖项 / Pycharm 无法识别它们