LoginSignup
114

More than 5 years have passed since last update.

git pull を --set-upstream-to で引数無しで実行可能にする

Last updated at Posted at 2013-06-28

--set-upstream-to を使う

git pull は基本は引数が必要

$ 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> branch_name

デフォルト参照先を決めるのには、各ローカルブランチごとに --set-upstream-to を使う

$ git branch --set-upstream-to=origin/master master
$ git branch --set-upstream-to=origin/develop develop
$ git branch --set-upstream-to=origin/gh-pages gh-pages

設定の一覧を見るには git branch -vv

教えていただいた

$ git branch -vv
* develop  6834af6 [origin/develop] Commit message..
  gh-pages aec8d8f [origin/gh-pages] Commit message..
  master   ac4f990 [origin/master] Commit message..

こんな -vv ダブルピースなオプションあったんですね..

git push -u origin branch_name でお手軽登録

教えていただいた、その2

$ git push -u origin master

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
114