AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1885182
Accepted
yaris
yaris
Asked: 2025-03-10 11:11:10 +0800 CST2025-03-10 11:11:10 +0800 CST 2025-03-10 11:11:10 +0800 CST

解读 Git 拉取消息

  • 772
minnymouse@XXXXXXX  /c/XXXXXXXXX/XXXXXXXXX/XXXXXXXXX (development)
$ git status
On branch development
Your branch is ahead of 'origin/development' by 2 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

minnymouse@XXXXXXX /c/XXXXXXXXX/XXXXXXXXX/XXXXXXXXX (development)
$ git push origin development
To ssh://xxxxxx/xxx/xxxxx/git/repos/xxxxx
 ! [rejected]        development -> development (fetch first)
error: failed to push some refs to 'ssh://xxxxxx/xxx/xxxxx/git/repos/xxxxx'
hint: Updates were rejected because the remote contains work that you do not
hint: have locally. This is usually caused by another repository pushing to
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

minnymouse@XXXXXXX /c/XXXXXXXXX/XXXXXXXXX/XXXXXXXXX (development)
$ git pull
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 10 (delta 5), reused 0 (delta 0)
Unpacking objects: 100% (10/10), 1.06 KiB | 43.00 KiB/s, done.
From ssh://xxxxxx/xxx/xxxxx/git/repos/xxxxx
   7948726..7dc3f5c  development     -> origin/development
   b9042ed..d04db55  feature/luxor   -> origin/feature/luxor
   7948726..7dc3f5c  production      -> origin/production
hint: Waiting for your editor to close the file...

如果我关闭编辑器而没有评论,是否会完全中止拉取?如果不是,编辑器文件中的消息是什么意思:

# Lines starting with '#' will be ignored, and an empty message aborts the commit.

所有这些都会集成到我的本地开发副本中吗?如果不是,这样做的目的是什么?

7948726..7dc3f5c  development     -> origin/development
b9042ed..d04db55  feature/luxor   -> origin/feature/luxor
7948726..7dc3f5c  production      -> origin/production
git
  • 1 1 个回答
  • 24640 Views

1 个回答

  • Voted
  1. Best Answer
    DrZoo
    2025-03-10T13:36:35+08:002025-03-10T13:36:35+08:00

    如果您关闭编辑器,它不会中止拉取。当您再次打开它时,您仍处于合并状态。

    这里发生的事情是,你正试图将代码推送到开发远程分支。但是,它识别出你没有及时了解当前开发中的内容。因此,它拒绝了你的推送,并告诉你先拉取当前的开发状态,以便 git 可以确定是否存在任何需要解决的合并冲突,然后才能推送。

    在这种情况下,您没有任何合并冲突。当提示# Lines starting with '#' will be ignored, and an empty message aborts the commit.出现时,这是 vi 或 vim 要求您进行交互。如果它已经处于输入模式,您只需输入:wq并按回车键。然后您可以再次推送。

    如果不是处于输入模式,您需要按i,然后根据需要输入合并消息,然后esc,输入:wq并点击enter

    最终,您似乎想要拥有自己的本地分支,可以将其推送到该分支,然后稍后将其合并到开发中,最好是通过拉取请求。

    要启动您自己的新的本地开发分支,您需要处于开发状态,确保您拥有最新的副本,git pull然后执行git checkout -b branchName以下操作:git checkout -b my-new-branch

    • 6

相关问题

  • Windows 10:无法打开(以前的)Git 存储库中的 .ttf 文件

  • GitLab:您不能推送 . 您只能推送使用您自己的已验证电子邮件之一提交的提交

  • 更改 git init 默认分支名称

  • 混帐添加。命令不工作

  • 提交后从git恢复已删除的文件

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Vickel Firefox 不再允许粘贴到 WhatsApp 网页中? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve