惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
博客园_首页
Google DeepMind News
Google DeepMind News
博客园 - 【当耐特】
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
B
Blog RSS Feed
人人都是产品经理
人人都是产品经理
MongoDB | Blog
MongoDB | Blog
量子位
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
有赞技术团队
有赞技术团队
Jina AI
Jina AI
GbyAI
GbyAI

博客园 - s1ihome

弹框居中的方法 Uiautomatorviewer报错:Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationTargetException 常见银行卡号账号长度参考表 TP5.0 数据库查询is not null vscode 中sftp配置 移动端H5上传图片并压缩上传 Thinkphp关联模型使用 centos 7 pdo thinkphp 5 where 组合条件map数组or [转]处理上百万条的数据库如何提高处理查询速度 连接oracle读取数据 SQL SERVER批量修改表名前缀 php导出excel java开发微信公众平台备忘 AngularJS小试牛刀 spring mvc开发过程知识点记录 微信公众平台项目中遇到的小问题40016,Invalid button size Dynamic Virtual Channels 木马的隐藏方式
如何 clone git 项目到一个非空目录
s1ihome · 2021-04-03 · via 博客园 - s1ihome

如果我们往一个非空的目录下 clone git 项目,就会提示错误信息:

fatal: destination path '.' already exists and is not an empty directory.

解决的办法是:

1. 进入非空目录,假设是 /workdir/proj1

2. git clone --no-checkout https://git.oschina.net/NextApp/platform.git tmp

3. mv tmp/.git .   #将 tmp 目录下的 .git 目录移到当前目录

4. rmdir tmp

5. git reset --hard HEAD

然后就可以进行各种正常操作了。