3

作業中のブランチをリモート ブランチにプッシュしようとしています。私はメッセージを受け取っていました:

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に非常に慣れていません。この現在の画面から抜け出す方法と、私が何をしようとしているのかを説明できる人はいますか?

4

1 に答える 1

2

現在、「オリジン」にある「マスター」ブランチの新しいものを、ローカル バージョンの「マスター」ブランチに「マージ」しています。そうすると、メッセージで何をしているのかを説明するように求められます。変更内容を入力して、Return キーを押します。

すべてが正しいことを確認するには、次のことを試してください。オリジンの最新のステータスを「フェッチ」し、最新であることを確認するためだけに変更をプルします。新しい変更をコミットしてから、サーバーにプッシュします。「-a」は、変更されたものをすべてコミットします。あなたもする必要があるかもしれませんgit add <some file that has changed>

git fetch    
git pull origin master
git commit -m"my changes" -a
git push origin master
于 2013-01-24T17:44:23.713 に答える