How do I pull/fetch with Git *INTO* a bare repository?

て烟熏妆下的殇ゞ 提交于 2019-11-29 06:34:25
Michael Krelin - hacker

Try

git fetch https://github.com/SamSaffron/dapper-dot-net.git master:master
doak

To backup the remote repository into your bare repository regulary configure first

git config remote.origin.url https://github.com/SamSaffron/dapper-dot-net.git
git config remote.origin.fetch "+*:*"

and then simply run

git fetch --prune

to backup.

  • You probably can skip the fist configuration addition as this should has been already set while cloning the remote repository.
  • Please also mind the enclosing double quotation marks (") in the above command to protect the asterix (*) not to be interpreted from your shell.
  • The plus sign is needed to allow non-fastforward updates. That is probably your intention if you want to backup the current state of your remote.
  • Option --prune is used to also delete by now non-existent branches.

I think you if you really want to backup. You can try $ git clone --mirror XXXX command. it will get almost everything from repository. Hope it is helpful.

$ git fetch https://github.com/SamSaffron/dapper-dot-net.git +refs/heads/*:refs/heads/* --prune
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!