Git裸仓库和非裸仓库

作者: SplendorZhang | 来源:发表于2017-03-29 22:45 被阅读0次

    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命令可以看到提交文件

    Paste_Image.png

    修改bare = false可以把裸仓库转换为非裸仓库

    Paste_Image.png

    相关文章

      网友评论

        本文标题:Git裸仓库和非裸仓库

        本文链接:https://www.haomeiwen.com/subject/nqoyottx.html