gpt4 book ai didi

Git、Git Pull 和转义

转载 作者:太空狗 更新时间:2023-10-29 14:15:05 28 4
gpt4 key购买 nike

我正在尝试将我正在处理的分支推送到它的远程分支。我收到消息:

error: failed to push some refs to 'website.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

我运行 git pull origin 并收到消息:

you asked to pull from the remote 'origin', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.

当运行 git push origin branch_name 时,我得到了与上面相同的错误,所以我运行了 git pull origin master

我觉得这没有按照我的意图进行,现在想以某种方式逃避/中止最后一条命令。我当前的屏幕显示:

From website.com

* branch master -> FETCH_HEAD
Auto-merging config/routes.rb

Merge branch 'master' of website into branch

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
~
~
~
~

-- INSERT --

抱歉,我是 git 的新手。谁能向我解释如何退出当前屏幕以及它要我做什么?

最佳答案

您目前正在将位于“origin”的“master”分支上的任何新内容“merge ”到您本地版本的“master”分支中。当你这样做时,它会要求你用一条消息解释你在做什么。输入一些内容来说明更改是什么,然后按回车键。

为确保一切正常,请尝试以下操作。 “获取”源的最新状态,提取任何更改以确保您是最新的。提交任何新更改,然后将它们推送到服务器。 “-a” 提交任何已更改的内容。您可能还需要做 git add <some file that has changed>

git fetch    
git pull origin master
git commit -m"my changes" -a
git push origin master

关于Git、Git Pull 和转义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14506801/

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