0

通常、リモートブランチからデータを自動的に取得してマージしgit pullgit statusそのブランチにプッシュできるローカルコミットを表示します。

職場で新しいブランチが作成されました。いつものようにすると、次のようになります。

$ git st
# On branch mybranch-s48
# 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:   src/main/java/com/xxx/batch/bo/utils/DisplayTagUtils.java
#
no changes added to commit (use "git add" and/or "git commit -a")



$ git commit -am "Test git commit"
[mybranch-s48 28813a3] Test git commit
 1 files changed, 2 insertions(+), 0 deletions(-)


$ git st
# On branch mybranch-s48
nothing to commit (working directory clean)


$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.mybranch-s48.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:

    [branch "mybranch-s48"]
    remote = <nickname>
    merge = <remote-ref>

    [remote "<nickname>"]
    url = <url>
    fetch = <refspec>

通常、「プル」には何も必要ありません。ステータスには、プッシュするコミットが 1 つあることが示されます。

git pull origin mybranch-s48またははまだ使用できますgit push origin mybranch-s48

このブランチはリストにはありませんが、実行時Local branches configured for 'git pull':にリストにのみ含まれますLocal refs configured for 'git push':git remote show origin

誰か助けてくれませんか

4

1 に答える 1

1

アップストリーム ブランチを設定してみてください。

git branch mybranch-s48 --set-upstream origin/mybranch-s48

通常、リモートに存在するがローカル リポジトリには存在しないブランチをチェックアウトすると、リモート ブランチを「追跡」するためにローカル コピーが作成されます。ローカル ブランチを別の方法で作成し、リモート ブランチを追跡する必要があることを Git がまだ認識していない場合は、--set-upstream.

于 2012-11-27T14:48:40.880 に答える