我有一个本地存储库,我想要镜像到远程'websrv‘。在我删除一个本地分支之前,这过去一直很好。现在当我做了
git push --mirror websrv
我得到了
remote: error: By default, deleting the current branch is denied, because the next
remote: error: 'git clone' won't result in any file checked out, causing confusion.
remote: error:
remote: error: Y
我在Git上有两个远程存储库public和private,在我自己的计算机上有一个本地存储库local。有时,我需要将我的本地存储库与来自public和private的最新提交合并,如下所示: $ git pull # pull from the private repo
$ git pull public main # pull from the public repo
$ git commit -a -m 'Merged public and private' 然后推回到两个远程的位置。 $ git push # push to the private repo
$
我已经裸克隆了一个公共github存储库(比如projectA),并创建了一个私有github存储库(比如projectAPrivate),然后mirror将克隆的projectA推送到projectAPrivate(如所示
git clone --bare https://github.com/exampleuser/old-repository.git
# Make a bare clone of the repository
cd old-repository.git
git push --mirror https://github.com/exampleuser/new-reposi