[英]git fetch - missing commits
I am running etckeeper
on two different machines, boxA
and boxB
. 我正在
etckeeper
在两台不同的机器, boxA
和boxB
。 The OS, etckeeper
repository and all, on boxB
was copied from boxA
back in January. 在一
boxB
,从boxA
复制了boxA
上的OS, etckeeper
存储库以及所有内容。 In order to apply some setup changes made on boxA
to boxB
, I added the repository on boxA
as a remote repository on boxB
with the intention of doing some cherry picking, eg: 为了应用上取得了一定的设置更改
boxA
到boxB
,我加入了资源库上boxA
作为远程仓库boxB
与做一些采摘樱桃,例如意向:
git remote add boxA ssh://boxA/etc
git fetch boxA
git cherry-pick xxxx # never got this far
The problem is that the most recent commits are not available on boxA
, only commits up until late February. 问题在于
boxA
上没有最新提交,仅直到2月下旬才提交。 So far I have tried: 到目前为止,我已经尝试过:
doing git show
with one of the missing commit numbers - this is definitely not a problem with git log
just not showing all the commits. 用丢失的提交编号之一进行
git show
- git log
只是不显示所有提交绝对不是问题。
copying the full /etc
on boxA
to boxB
and adding/fetching it via its path - this is definitely not an issue somehow introduced by ssh
(to complicate things I was using a script via the GIT_SSH
environment variable to avoid creating a root
login). 将
boxA
上的完整/etc
复制到boxB
并通过其路径添加/获取-绝对不是ssh
引入的问题(为了使我正在使用通过GIT_SSH
环境变量使用脚本的事情复杂化,以避免创建root
登录)。
git fsck
on both repositories (no problems found). 两个存储库上的
git fsck
(未发现问题)。
running the following command on copied version of both repositories (after doing a git remote remove boxA
on boxB
and before readding): 在两个存储库的复制版本上运行以下命令(在
git remote remove boxA
上对boxB
git remote remove boxA
boxB
并在读取之前):
git -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 \\ -c gc.rerereresolved=0 -c gc.rerereunresolved=0 -c gc.pruneExpire=now gc \\ --aggressive
How can I get git fetch
to retrieve all of the commits? 如何获取
git fetch
来检索所有提交?
So the problem here turned out to be that there was a detached head in the repository on boxA
after an incomplete fix of a botched rebase. 因此,这里的问题原来是在对
boxA
库进行不完全修复之后, boxA
上的存储库中有一个分离的头部 。 When this happens the output of git branch
is as follows: 发生这种情况时,
git branch
的输出如下:
# git branch
* (no branch)
master
The fix was simply to create a branch on boxA
and then merge it: 解决方法只是在
boxA
上创建一个分支,然后将其合并:
git branch temp
git checkout master
git merge temp
git branch -d temp
After that all the commits on branch master (or at least what I thought was branch master) were available after doing another git fetch
. 之后,在执行另一个
git fetch
之后,就可以使用分支母版上的所有提交(或者至少我认为是分支母版)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.