gpt4 book ai didi

Git:Branch 领先 X 次提交。做 git pull 无济于事

转载 作者:太空狗 更新时间:2023-10-29 13:29:13 36 4
gpt4 key购买 nike

我确实看到其他类似的问题,但我真的不明白为什么会这样。现在,我正在使用 git reset --hard HEAD 然后手动添加我的更改。建议的解决方案似乎是 git pull origin master?但在那之后我仍然收到同样的信息。怎么了?我如何进行 merge ?我对 GIT 还是比较陌生

$ git pull origin master
Nodester!
Enter passphrase for key '/home/jiewmeng/.ssh/id_rsa':
From nodester.com:/node/git/jiewmeng/10267-f62c0a21d1a9d75ab7b6ace5858921d0
* branch master -> FETCH_HEAD
Merge made by the 'recursive' strategy.

$ git branch -a
* master
remotes/origin/master

最佳答案

如“Why is Git telling me “Your branch is ahead of 'origin/master' by 11 commits.” and how do I get it to stop?”中所述

"your branch is ahead by..." => You need to push to the remote master.
Run "git diff origin/master" to see what the differences are between your local repository and the remote master repository.

如果您在一次提交之前领先于远程仓库,那么过时的是远程仓库,而不是您。
pull 也无济于事。

现在还要检查你是否真的在一个分支上(而不是在一个分离的头上)。
这是你的情况(你确实在 master 分支上)

关于Git:Branch 领先 X 次提交。做 git pull 无济于事,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10966498/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com