ユーザ用ツール

サイト用ツール


Action disabled: backlink
git_pull

git のサブコマンド。git_push の逆。

「git pull は常に現在のブランチにマージする」

git pull すると作業ディレクトリのリポジトリも作業ファイルも更新される。

[local-pc にて]
$ git pull nishi@remote-pc:/data/work-dir master
nishi@remote-pc's password: 
remote: Counting objects: 13, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 8 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.
From nishi@remote-pc:/data/work-dir
 * branch            master     -> FETCH_HEAD
Updating 98a831a..9e7dc32
Fast forward
 rakefile.rb         |   14 ++++++++++++--
 4 files changed, 85 insertions(+), 15 deletions(-)
 mode change 100755 => 100644 data.csv

remote に複数のブランチがあり、ブランチを指定しないで pull しようとすると:

$ git pull nishi-at-remote
nishi@remote's password: 
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 4), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
From nishi@remote:/data/nishi/rubyhtk
   212ad01..458567e  master     -> nishi-at-remote/master
 * [new branch]      step1      -> nishi-at-remote/step1
 * [new branch]      step2      -> nishi-at-remote/step2
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either.  Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details on the refspec.

If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:

    branch.master.remote = <nickname>
    branch.master.merge = <remote-ref>
    remote.<nickname>.url = <url>
    remote.<nickname>.fetch = <refspec>

See git-config(1) for details.
git_pull.txt · 最終更新: 2011/02/15 01:04 by Takuya Nishimoto

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki