Git基本操作

2025-06-04 22:23:00
丁国栋
原创 7
摘要:本文记录和汇总Git的一些基本操作,持续更新中。

1. 裸仓库转换为工作区仓库

如果我有一个git仓库的raw数据,这个git仓库raw数据是服务器端的git仓库(通常是一个裸仓库 bare repository),如何把它转换为工作区可用的仓库?

方法1(推荐):git clone /path/to/your/bare/repo.git new_working_dir

方法2:在一个空的仓库中添加远程 git remote add origin /path/to/your/bare/repo.git 后检出。


发表评论
博客分类