git pull 报错

这篇具有很好参考价值的文章主要介绍了git pull 报错。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:

问题:

aaa@bbb:~/xxx/xxx/xx/xxx$ git status .
On branch cornerstone_security
Your branch and 'origin/dev' have diverged,
and have 3 and 3 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

nothing to commit, working tree clean
aaa@bbb:~/xxx/xxx/xx/xxx$ git pull
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.

解决:

aaa@bbb:~/xxx/xxx/xx/xxx$ git pull --rebase origin dev
From ssh://sdv-gerrit.xxx.local:29418/xxx/xxx/xx
 * branch            dev        -> FETCH_HEAD
Successfully rebased and updated refs/heads/xxx.

git pull --rebase origin dev 

上述命令等同于:

git fetch origin

git rebase origin/dev

引用:git Your branch and 'origin/dev' have diverged - SegmentFault 思否文章来源地址https://www.toymoban.com/news/detail-461090.html

到了这里,关于git pull 报错的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • git常见问题 — git pull时提示 git pull <remote> <branch>

    git pull的时候提示git pull 说明,当前的分支并没有和本地分支关联,根据提示进行下一步: 1.将指定当前工作目录工作分支,跟远程的仓库分支之间进行关联 2.再次拉取代码

    2024年02月11日
    浏览(51)
  • git pull时自动产生 Merge branch

    如下图,在提交代码时,在自己的提交前面多出了一笔merge提交,这笔提交的内容实际上是在本地仓库进行git pull时,本地仓库更新的远程仓库中代码的内容 本地分支与远程分支存在分叉 分叉就是你在本地仓库做项目的时候,将自己的修改的代码Commit到本地了,而同时你的其

    2024年02月16日
    浏览(37)
  • git pull时提示 master has no tracked branch

    可能是因为远程仓库和本地仓库起始不一致导致的问题 注意:工作中,请根据具体场景,进行分析,执行此命令要慎重 原文链接

    2024年02月03日
    浏览(38)
  • git clone -b与git pull origin <branch_name>的区别

    git clone -b 和 git pull origin branch_name 都是用于在 Git 中操作分支的命令,但它们有不同的用途和行为。 这是在克隆仓库时指定要克隆的特定分支的命令。它用于在克隆一个仓库的同时指定要克隆的分支。例如,如果你只想克隆一个特定分支的内容,可以使用以下命令: 这将克隆

    2024年02月12日
    浏览(32)
  • git 出现 There is no tracking information for the current branch. Please specify which branch you want

    问题分析:当前pull对象没有远程分支的跟踪信息,简单地来说就是你创建的这个分支没有和远程仓库中的其他分支或者master建立联系,所以导致当前分支无法进行pull操作; 解决方案: git branch --set-upstream-to=origin/remote_name local_name 注解: remote_name : 远程分支名 // 这里是你创

    2024年02月05日
    浏览(37)
  • git pull无效,显示 * branch master -> FETCH_HEADAlready up to date. pull无效解决方法

    本地文件夹中删除文件后 ,git pull无效。显示如下: 命令如下: 比如错删a.txt: 一个命令恢复全部文件: 参考文章如下: 【Git 教程系列第 22 篇】删除本地文件后,使用 git pull 命令从远程仓库无法拉取到被删除文件的解决方案_git 删除本地文件再pull没有_Allen Su的博客-CSDN博客

    2024年02月15日
    浏览(49)
  • git pull Your configuration specifies to merge with the ref ‘refs/heads/xxxx‘ from the remote, but n

    Your configuration specifies to merge with the ref ‘refs/heads/xxxx’ from the remote, but no such ref was fetched.) 1.主要是因为网页上仓库fork别人的,更新了就没了分支,但是本地还有 2.需要切换到丢失的分支下,需要先解锁: 3.然后在执行git pull会有提示: 但是这样问题还不能根本性的解决:

    2024年02月04日
    浏览(44)
  • 【Git】Git报错:Branch ‘master‘ set up to track remote branch ‘master‘ from ‘orgin‘

    前言 :如果遇到将从git上拉取的代码,直接上传到新的git仓库地址,注意,需要修改git源,否则,会报错。 报错信息如下: Git报错:Branch ‘master’ set up to track remote branch ‘master’ from ‘orgin’ 解决方案: ①移除之前的git源: ②再次连接新的git源:

    2024年02月11日
    浏览(41)
  • git pull 报错

    hint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: 问题: aaa@bbb:~/xxx/xxx/xx/xxx$ git status . On branch cornerstone_security Your branch and \\\'origin/dev\\\' have diverged, and have 3 and 3 different commits each, respectively.   (u

    2024年02月06日
    浏览(33)
  • 【Git】push分支报错:fatal: The current branch 当前分支名 has no upstream branch

    示例代码: feature/file 是分支名 中文释义: 在于当前这个分支没有和任何的仓库发生关联,origin是仓库的一个指针,需要将当前的分支与这个指针之间形成关联。 直接允许以下命令即可 执行之后会在 github 上自动新建一个 feature/file 的分支。

    2024年02月11日
    浏览(50)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包