git跨越分支的问题:致命:无法找到远程引用

时间:2011-12-27 19:00:02

标签: git git-pull

我知道我做错了什么,但不知道它搞砸了什么或者如何纠正它。

所以我在与主人相同的分支产品上。然后我有另一个分支发布-28122011。我正在发布-28122011。然后我做了

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

然后我意识到我的错误并试图从发布中执行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 you@example.com

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

1 个答案:

答案 0 :(得分:0)

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