假设我有一个本地存储库A并且我可以访问远程存储库B。这些存储库完全不同!我想将所有文件/提交等从A推送到B存储库。所以我做了以下git命令:
git remote add origin <my remote git url>git push origin master
我收到以下错误:
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
问题的原因是我不想执行git pull命令,因为B存储库占用了大量空间(数千兆字节!),而A存储库占用了几千字节。
有什么方法可以不用拉就推吗?