克隆并推回到.git文件,而不是.git目录

时间:2015-12-10 17:44:29

标签: git push

好吧,我知道error: failed to push some refs to是git中的一个常见问题,网上有很多关于它的资料,但没有任何帮助。那么让我解释一下这个问题:

我收到了name.git个文件,而不是文件夹。我做了:

git clone name.git name这会使用代码生成我的name目录 我努力了,做了一系列的提交。没有什么可以承诺的。 (这都在我的本地机器上,所以没有人同时承诺,但......)我仍然git pullAlready up to date。好的,git push,它会响应error: failed to push some refs to

现在,我需要向其他人提供我的提交。我知道,我可以rar / zip我的name目录,但是我想要一个name.git文件来回馈,其中包括我的提交日志。任何人都知道发生了什么事?

1 个答案:

答案 0 :(得分:1)

我想我现在明白了。

你可能收到了一个“git bundle”,并且git bundle根本不喜欢被推送到,显然。

http://rypress.com/tutorials/git/tips-and-tricks

中获取线索

注 - 假设您可以使用Linux-esque touch命令创建纯空文件

创建新项目:

mkdir foo
cd foo
touch hello
git add .
git commit -m "first commit"

创建捆绑包:

git bundle create ../foo.git master

使用捆绑包:

cd ..
git clone foo.git foo-clone -b master
cd foo-clone
touch world
git add .
git commit -m "second commit"

尝试推送到捆绑,但失败了:

git push origin master
  

错误:未能将某些引用推送到[foo.git] *

* foo.git路径实际上是扩展出来的

因此,也许你也可以捆绑你的存储库并将其运回上游。

添加 - 您也可以在上游提交“git-format-patch”样式的补丁;它远远不如捆绑重。

或者,您和您的团队可以探索GitHubGitLabBitBucket

等解决方案

注意 - GitLab和BitBucket有“本地安装,完全隐私”的选项。