Git裸仓库创建 使用命令行:git init –bare 使用TortoiseGit:右键菜单git creat repo here,选择Make it Bare
裸仓库可以直接作为服务器仓库供各开发者push、pull数据,实现数据共享和同步,不保存文件,只保存历史提交的版本信息
非裸仓库创建:git init使用TortoiseGit:右键菜单git creat repo here,不选择Make it Bare
向非裸仓库push文件会报错,需要在.git 文件夹的config文件后加一句
[receive]
denyCurrentBranch = ignore
才能提交数据,非裸仓库使用git reset --hard命令可以看到提交文件
修改bare = false可以把裸仓库转换为非裸仓库
Paste_Image.png
网友评论