2017-08-29 9 views
-4

私は書くことができるようにしたい:`git pull`はどのように` git pull origin master`を実行するのですか?

$ git pull 
// does the same as $ git pull origin master 
$ git push 
// does the same as $ git push origin master 

私は$ git pullを行う際に、現在私が手を除い:

There is no tracking information for the current branch. 
Please specify which branch you want to merge with. 
See git-pull(1) for details. 

    git pull <remote> <branch> 

If you wish to set tracking information for this branch you can do so with: 

    git branch --set-upstream-to=origin/<branch> master 
+3

可能な重複リモートブランチ?](https://stackoverflow.com/questions/520650/make-an-existing-git-branch-track-a-remote-branch) –

+1

答えは質問です。 – axiac

+0

質問に貼り付けた 'git pull'の出力を実際に_read_するのに15秒かかると考えてください。 Gitコマンドは混乱した出力を生成することがありますが、これは非常に明確なフィードバックの例だと思います。 – Chris

答えて

2

それはすぐそこのエラーメッセージでそう言う:

git branch --set-upstream-to=origin/master master 

もちろん、ブランチmasterもローカルであるとします。

上流の平均の設定は何ですか?リモート追跡ブランチ からローカルブランチをチェックアウトする

は、自動的に「追跡ブランチ」(と、それは追跡 ブランチが「上流分岐」と呼ばれている)と呼ばれるものを作成します。トラッキングブランチ は、リモートブランチと直接の関係を持つローカルブランチです。 あなたが追跡ブランチとタイプgitのプルにしている場合は、Gitが自動的に

ソースにマージするからフェッチと分岐先のサーバーを知っている:[既存のGitのブランチトラックを作るのthe Git book

+0

「上流」とは何か説明できますか? – 14wml

+2

私はそれを[Git book](https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches)に任せます。 – Thomas

+0

そして、 'git branch -set-upstream-to = origin/master master'というコマンドは何を意味していますか? – 14wml

関連する問題