git pull 跨分支的问题:致命:找不到远程引用

发布于 2024-12-23 04:52:29 字数 7547 浏览 1 评论 0原文

我知道我做错了什么,但不知道哪里出了问题,也不知道如何纠正。

所以我使用的是与 master 相同的分支产品。然后我有另一个分支版本-28122011。我正在开发版本 28122011。然后我做了

git pull origin 产品——这可能已经更新了发布分支中的一些引用以更新到产品

,然后我意识到我的错误并尝试从发布中执行 git pull 但它引发了致命错误。有什么办法可以纠正这个问题吗?

kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git stash
Saved working directory and index state WIP on release-28122011: 4ab88ba Merge branch 'release-28122011' of ssh://182.71.101.50/BigHelloWorld into release-28122011
HEAD is now at 4ab88ba Merge branch 'release-28122011' of ssh://182.71.101.50/BigHelloWorld into release-28122011
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ gs
# On branch release-28122011
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   BigHelloWorldWeb/src/main/java/com/BigHelloWorld/web/filter/RequestIdentifierFilter.java
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/about.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/addressDetails.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/failureNotice.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/home.jsp
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   BigHelloWorldWeb/src/main/webapp/views/mobile/docomo/
no changes added to commit (use "git add" and/or "git commit -a")
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git add .
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ gs
# On branch release-28122011
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   modified:   BigHelloWorldWeb/src/main/java/com/BigHelloWorld/web/filter/RequestIdentifierFilter.java
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/about.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/addressDetails.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/failureNotice.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/home.jsp

kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git commit -m "WAP fixes 8" BigHelloWorldWeb/src/main/java/com/BigHelloWorld/web/filter/RequestIdentifierFilter.java BigHelloWorldWeb/src/main/webapp/views/mobile/set1/about.jsp BigHelloWorldWeb/src/main/webapp/views/mobile/set1/addressDetails.jsp BigHelloWorldWeb/src/main/webapp/views/mobile/set1/failureNotice.jsp BigHelloWorldWeb/src/main/webapp/views/mobile/set1/home.jsp
[release-28122011 a7067bb] WAP fixes 8
 Committer: kamal <kamal@kamal-Lenovo-G470.(none)>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email [email protected]

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 21 files changed, 738 insertions(+), 152 deletions(-)
 create mode 100644 BigHelloWorldWeb/src/main/webapp/views/mobile/docomo/purchaseConfirm.jsp
 create mode 100644 BigHelloWorldWeb/src/main/webapp/views/mobile/docomo/purchaseUserDetails.jsp
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git pull origin product
remote: Counting objects: 125, done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 80 (delta 38), reused 0 (delta 0)
Unpacking objects: 100% (80/80), done.
From ssh://192.168.2.251/BigHelloWorld
 * branch            product    -> FETCH_HEAD
Auto-merging BigHelloWorldResources/build/build.sql
Merge made by recursive.
 .../impl/CustomerCareAdminServiceImpl.java         |   16 ++-
 .../catalog/impl/ProductBulkUploadAdminImpl.java   |   21 +++--
 .../com/BigHelloWorld/core/dto/OrderItemDetailDTO.java  |   49 ++++++---
 .../com/BigHelloWorld/core/dto/SuborderDetailDTO.java   |   12 ++
 .../com/BigHelloWorld/core/dto/filter/FilterDTO.java    |  113 ++++++++++++++++++++
 .../BigHelloWorld/core/dto/filter/FilterListDTO.java    |   25 +++++
 .../main/java/com/BigHelloWorld/core/entity/Filter.java |   75 +++++++++++++
 .../java/com/BigHelloWorld/core/entity/FilterValue.java |   70 ++++++++++++
 .../com/BigHelloWorld/core/entity/ProductCategory.java  |   22 +++-
 .../com/BigHelloWorld/core/entity/ProductOffer.java     |   12 ++
 BigHelloWorldResources/build/build.sql                  |    6 +-
 .../java/com/BigHelloWorld/dao/filter/IFilterDao.java   |   29 +++++
 .../BigHelloWorld/dao/filter/impl/FilterDaoImpl.java    |   73 +++++++++++++
 .../BigHelloWorld/services/filter/IFilterService.java   |   28 +++++
 .../services/filter/impl/FilterServiceImpl.java    |   56 ++++++++++
 .../BigHelloWorld/web/controller/FilterController.java  |   78 ++++++++++++++
 .../webapp/WEB-INF/spring/applicationContext.xml   |    2 +
 .../main/webapp/WEB-INF/spring/spring-servlet.xml  |    1 +
 .../src/main/webapp/views/customer/orderDetail.jsp |    9 ++-
 19 files changed, 663 insertions(+), 34 deletions(-)
 create mode 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/dto/filter/FilterDTO.java
 create mode 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/dto/filter/FilterListDTO.java
 create mode 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/entity/Filter.java
 create mode 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/entity/FilterValue.java
 mode change 100644 => 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/entity/ProductCategory.java
 mode change 100644 => 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/entity/ProductOffer.java
 mode change 100644 => 100755 BigHelloWorldResources/build/build.sql
 create mode 100755 BigHelloWorldServices/src/main/java/com/BigHelloWorld/dao/filter/IFilterDao.java
 create mode 100755 BigHelloWorldServices/src/main/java/com/BigHelloWorld/dao/filter/impl/FilterDaoImpl.java
 create mode 100755 BigHelloWorldServices/src/main/java/com/BigHelloWorld/services/filter/IFilterService.java
 create mode 100755 BigHelloWorldServices/src/main/java/com/BigHelloWorld/services/filter/impl/FilterServiceImpl.java
 create mode 100755 BigHelloWorldWeb/src/main/java/com/BigHelloWorld/web/controller/FilterController.java
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git pull origin product
From ssh://192.168.2.251/BigHelloWorld
 * branch            product    -> FETCH_HEAD
Already up-to-date.
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git status
# On branch release-28122011
# Your branch is ahead of 'origin/release-28122011' by 8 commits.
#
nothing to commit (working directory clean)
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git pull origin release-28122011
fatal: Couldn't find remote ref release-28122011
fatal: The remote end hung up unexpectedly
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git checkout release-28122011
Already on 'release-28122011'
Your branch is ahead of 'origin/release-28122011' by 8 commits.
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git status
# On branch release-28122011
# Your branch is ahead of 'origin/release-28122011' by 8 commits.
#
nothing to commit (working directory clean)
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git pull origin release-28122011
fatal: Couldn't find remote ref release-28122011
fatal: The remote end hung up unexpectedly

I know what I did wrong but don't know what it messed up or how it can be rectified.

So I was on branch product which is same as master. Then I have another branch release-28122011. I was working on release-28122011. Then I did

git pull origin product -- this may have updated some references in the release branch to update to product

then I realized my mistake and tried to do git pull from release but it throws fatal errors. Is there any way to rectify this.

kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git stash
Saved working directory and index state WIP on release-28122011: 4ab88ba Merge branch 'release-28122011' of ssh://182.71.101.50/BigHelloWorld into release-28122011
HEAD is now at 4ab88ba Merge branch 'release-28122011' of ssh://182.71.101.50/BigHelloWorld into release-28122011
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ gs
# On branch release-28122011
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   BigHelloWorldWeb/src/main/java/com/BigHelloWorld/web/filter/RequestIdentifierFilter.java
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/about.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/addressDetails.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/failureNotice.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/home.jsp
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   BigHelloWorldWeb/src/main/webapp/views/mobile/docomo/
no changes added to commit (use "git add" and/or "git commit -a")
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git add .
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ gs
# On branch release-28122011
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   modified:   BigHelloWorldWeb/src/main/java/com/BigHelloWorld/web/filter/RequestIdentifierFilter.java
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/about.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/addressDetails.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/failureNotice.jsp
#   modified:   BigHelloWorldWeb/src/main/webapp/views/mobile/set1/home.jsp

kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git commit -m "WAP fixes 8" BigHelloWorldWeb/src/main/java/com/BigHelloWorld/web/filter/RequestIdentifierFilter.java BigHelloWorldWeb/src/main/webapp/views/mobile/set1/about.jsp BigHelloWorldWeb/src/main/webapp/views/mobile/set1/addressDetails.jsp BigHelloWorldWeb/src/main/webapp/views/mobile/set1/failureNotice.jsp BigHelloWorldWeb/src/main/webapp/views/mobile/set1/home.jsp
[release-28122011 a7067bb] WAP fixes 8
 Committer: kamal <kamal@kamal-Lenovo-G470.(none)>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email [email protected]

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 21 files changed, 738 insertions(+), 152 deletions(-)
 create mode 100644 BigHelloWorldWeb/src/main/webapp/views/mobile/docomo/purchaseConfirm.jsp
 create mode 100644 BigHelloWorldWeb/src/main/webapp/views/mobile/docomo/purchaseUserDetails.jsp
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git pull origin product
remote: Counting objects: 125, done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 80 (delta 38), reused 0 (delta 0)
Unpacking objects: 100% (80/80), done.
From ssh://192.168.2.251/BigHelloWorld
 * branch            product    -> FETCH_HEAD
Auto-merging BigHelloWorldResources/build/build.sql
Merge made by recursive.
 .../impl/CustomerCareAdminServiceImpl.java         |   16 ++-
 .../catalog/impl/ProductBulkUploadAdminImpl.java   |   21 +++--
 .../com/BigHelloWorld/core/dto/OrderItemDetailDTO.java  |   49 ++++++---
 .../com/BigHelloWorld/core/dto/SuborderDetailDTO.java   |   12 ++
 .../com/BigHelloWorld/core/dto/filter/FilterDTO.java    |  113 ++++++++++++++++++++
 .../BigHelloWorld/core/dto/filter/FilterListDTO.java    |   25 +++++
 .../main/java/com/BigHelloWorld/core/entity/Filter.java |   75 +++++++++++++
 .../java/com/BigHelloWorld/core/entity/FilterValue.java |   70 ++++++++++++
 .../com/BigHelloWorld/core/entity/ProductCategory.java  |   22 +++-
 .../com/BigHelloWorld/core/entity/ProductOffer.java     |   12 ++
 BigHelloWorldResources/build/build.sql                  |    6 +-
 .../java/com/BigHelloWorld/dao/filter/IFilterDao.java   |   29 +++++
 .../BigHelloWorld/dao/filter/impl/FilterDaoImpl.java    |   73 +++++++++++++
 .../BigHelloWorld/services/filter/IFilterService.java   |   28 +++++
 .../services/filter/impl/FilterServiceImpl.java    |   56 ++++++++++
 .../BigHelloWorld/web/controller/FilterController.java  |   78 ++++++++++++++
 .../webapp/WEB-INF/spring/applicationContext.xml   |    2 +
 .../main/webapp/WEB-INF/spring/spring-servlet.xml  |    1 +
 .../src/main/webapp/views/customer/orderDetail.jsp |    9 ++-
 19 files changed, 663 insertions(+), 34 deletions(-)
 create mode 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/dto/filter/FilterDTO.java
 create mode 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/dto/filter/FilterListDTO.java
 create mode 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/entity/Filter.java
 create mode 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/entity/FilterValue.java
 mode change 100644 => 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/entity/ProductCategory.java
 mode change 100644 => 100755 BigHelloWorldCore/src/main/java/com/BigHelloWorld/core/entity/ProductOffer.java
 mode change 100644 => 100755 BigHelloWorldResources/build/build.sql
 create mode 100755 BigHelloWorldServices/src/main/java/com/BigHelloWorld/dao/filter/IFilterDao.java
 create mode 100755 BigHelloWorldServices/src/main/java/com/BigHelloWorld/dao/filter/impl/FilterDaoImpl.java
 create mode 100755 BigHelloWorldServices/src/main/java/com/BigHelloWorld/services/filter/IFilterService.java
 create mode 100755 BigHelloWorldServices/src/main/java/com/BigHelloWorld/services/filter/impl/FilterServiceImpl.java
 create mode 100755 BigHelloWorldWeb/src/main/java/com/BigHelloWorld/web/controller/FilterController.java
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git pull origin product
From ssh://192.168.2.251/BigHelloWorld
 * branch            product    -> FETCH_HEAD
Already up-to-date.
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git status
# On branch release-28122011
# Your branch is ahead of 'origin/release-28122011' by 8 commits.
#
nothing to commit (working directory clean)
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git pull origin release-28122011
fatal: Couldn't find remote ref release-28122011
fatal: The remote end hung up unexpectedly
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git checkout release-28122011
Already on 'release-28122011'
Your branch is ahead of 'origin/release-28122011' by 8 commits.
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git status
# On branch release-28122011
# Your branch is ahead of 'origin/release-28122011' by 8 commits.
#
nothing to commit (working directory clean)
kamal@kamal-Lenovo-G470:~/git/BigHelloWorld$ git pull origin release-28122011
fatal: Couldn't find remote ref release-28122011
fatal: The remote end hung up unexpectedly

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦途 2024-12-30 04:52:29

这可以通过 git reset --hard commit-before-screwup 来解决。 (但是硬重置本身并非没有危险。也许最好克隆存储库并在克隆中尝试。)

That may be curable with a git reset --hard commit-before-screwup. (But a hard reset is not without dangers itself. Perhaps better clone the repo and try in the clone.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文