Git-29:Git 仓库备份到本地

2019-04-04  本文已影响0人  WenxuanLi

李文轩 2019-02-26


本地备份

$ git clone --bare <source_path> <target_path>
$ git clone --bare file://<source_path> <target_path>
    
# --bare 指裸仓库,不包含工作区
# file://+<path>,切换到智能协议

哑协议与智能协议区别:

  1. 哑协议进度不可见,智能协议可见
  2. 智能协议速度快

与远端仓库发生关联

$ git remote -v
# 查看关联的远端
    
$ git remote add <name> file://<path(.git)>
# 与指定远端仓库发生关联
    
$ git push 
# 按实际情况的提示继续 push 的操作
# 把本地的 commited 的文件,同步到远端仓库
上一篇下一篇

猜你喜欢

热点阅读