ページの作成
親となるページを選択してください。
親ページに紐づくページを子ページといいます。
例: 親=スポーツ, 子1=サッカー, 子2=野球
子ページを親ページとして更に子ページを作成することも可能です。
例: 親=サッカー, 子=サッカーのルール
親ページはいつでも変更することが可能なのでとりあえず作ってみましょう!
| この記事の要点 |
|---|
|
エラーの状況
$ git pull
現在のブランチはプル用に構成されていません。
変更を統合するためには、以下を行ってください
git pull <リモート> <ブランチ>
さもなければ
git branch --set-upstream-to=<リモート>/<ブランチ> <ブランチ>
# 英語版
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>
原因
git pull は「現在のブランチに対応するリモートブランチ」(upstream / tracking branch) から fetch + merge します。upstream が設定されていないと「どのリモートブランチを pull するか」が分からずエラーになります。
upstream 設定の確認
# 現在の upstream
$ git branch -vv
* feature/login abc1234 [origin/feature/login] commit message
main def5678 [origin/main] another commit
local-only ghi9012 ← upstream なし
# git remote 設定
$ git remote -v
origin git@github.com:user/repo.git (fetch)
origin git@github.com:user/repo.git (push)
対処方法
方法 1: upstream を後から設定(推奨)
# 現在のブランチに upstream 設定
$ git branch --set-upstream-to=origin/main main
branch 'main' set up to track 'origin/main'.
# 短縮形
$ git branch -u origin/main
# 確認
$ git branch -vv
* main abc1234 [origin/main] commit message
# 以後は普通に pull
$ git pull
方法 2: pull 時にリモートとブランチを明示
$ git pull origin main
# remote = origin, branch = main を明示
# 短縮 (1 回だけならこれで OK)
# 毎回打つのは面倒 → upstream 設定を推奨
方法 3: push 時に -u で upstream 自動設定
# 新規ブランチを push しつつ upstream 設定
$ git push -u origin feature/new-feature
# = git push origin feature/new-feature + git branch -u origin/feature/new-feature
# 以後は普通に push / pull できる
$ git push
$ git pull
方法 4: グローバル設定で自動 upstream(推奨)
# 新規ブランチを push する時、自動的に upstream 設定
$ git config --global push.autoSetupRemote true
# 以後は push で -u 不要
$ git checkout -b new-feature
$ git push # → 自動的に origin/new-feature 作成 + upstream 設定
# Git 2.37+ で利用可能
状況別の対応
シナリオ 1: ローカルだけのブランチをリモートにプッシュ
# ローカルで作ったブランチ
$ git checkout -b feature/dashboard
# コミット
$ git add .
$ git commit -m "add dashboard"
# 初回 push (upstream 設定)
$ git push -u origin feature/dashboard
# 以後は普通に
$ git push
$ git pull
シナリオ 2: クローン直後で upstream 設定が消えた
# clone なら upstream は自動設定されているはず
$ git clone https://github.com/user/repo.git
$ cd repo
$ git pull # → OK
# それでもエラーなら fetch 確認
$ git fetch origin
$ git branch -r # リモートブランチ一覧
$ git branch --set-upstream-to=origin/main main
シナリオ 3: ローカルとリモートで名前が違うブランチ
# ローカル: feature/login
# リモート: features/login (s 違い)
# 明示的にマッピング
$ git branch --set-upstream-to=origin/features/login feature/login
# または fetch + checkout
$ git fetch origin features/login:feature/login
シナリオ 4: 別リポジトリの fork から pull
# 自分の fork: origin
# 元リポジトリ: upstream として追加
$ git remote add upstream https://github.com/original/repo.git
# upstream から pull
$ git fetch upstream
$ git merge upstream/main
# または直接
$ git pull upstream main
関連 git config 設定
# 新規ブランチに自動 upstream
$ git config --global push.autoSetupRemote true
# pull のデフォルト動作 (merge / rebase)
$ git config --global pull.rebase false # merge (デフォルト)
$ git config --global pull.rebase true # rebase
$ git config --global pull.ff only # fast-forward only
# branch.autoSetupMerge (新規ブランチ作成時)
$ git config --global branch.autoSetupMerge always
# true (デフォルト): リモートから派生したブランチのみ自動 tracking
# always: ローカル間でも自動 tracking
# false: 自動 tracking なし
# 設定確認
$ git config --list | grep -E "push|pull|branch"
upstream / tracking branch の概念
# upstream = 「このローカルブランチが追従するリモートブランチ」
# 設定済みの利点:
# - git pull / git push に引数不要
# - git status で「ahead of origin/main by 3 commits」と表示
# - git fetch でリモートの最新を取り込みやすい
# 確認コマンド
$ git config branch.main.remote # → origin
$ git config branch.main.merge # → refs/heads/main
# 削除
$ git branch --unset-upstream
# またはコンフィグから
$ git config --unset branch.main.remote
$ git config --unset branch.main.merge
関連エラー
| エラー | 意味 |
|---|---|
current branch has no tracking branch | このページ |
The current branch master has no upstream branch | push 時の同種エラー |
fatal: not a git repository | git 管理外 |
fatal: refusing to merge unrelated histories | 履歴非共通 |
関連記事
- git
- Cannot rebase: You have unstaged changes
- git rm [-r --cached] の取り消し
- error: pathspec did not match (git)
ページの作成
親となるページを選択してください。
親ページに紐づくページを子ページといいます。
例: 親=スポーツ, 子1=サッカー, 子2=野球
子ページを親ページとして更に子ページを作成することも可能です。
例: 親=サッカー, 子=サッカーのルール
親ページはいつでも変更することが可能なのでとりあえず作ってみましょう!
子ページ
子ページはありません
同階層のページ
- モジュール名が無効です。(WAR エクスポート)
- 現在のブランチはプル用に構成されていません 構成にキー remote.origin.url の値がありません
- サーバーに追加または除去できるリソースがありません。
- invalid LOC header (bad signature)
人気ページ
- 1 Eclipseで「サーバーに追加または除去できるリソースがありません。」の原因と対処法
- 2 tomcat の起動 / 停止ログと catalina.log・catalina.out の違い
- 3 JavaScript で base URL を取得する方法|window.location.origin
- 4 YouTube Data API v3 エラー一覧|403・400・404 の原因と対処
- 5 Laravel エラー一覧|500/Blade/DB 接続/ルーティングの代表エラー
- 6 Spring Frameworkのアノテーション一覧
- 7 3Dグラフィックスとは|モデリング/レンダリング/主要ソフトウェア (Blender / Maya)
- 8 【Spring】@Valueアノテーションとは
- 9 CATALINA_HOME の確認方法 (Linux / Mac)
- 10 【Spring】@Autowiredアノテーションとは
最近更新/作成されたページ
- PHPでのファイルアップロード方法|multipart/form-dataと$_FILES 2026-08-07 17:15:57
- PHP $_SERVERとは|DOCUMENT_ROOT・PHP_SELFなど主な要素 2026-08-07 17:15:57
- Scratchのアカウントの作り方|メールアドレスとユーザー名の登録手順 2026-08-07 17:15:57
- djangoにおけるMVCアプリケーション実装例 2026-08-07 17:15:57
- Bluetoothとは|仕組み・BLEとClassicの違い・用途 2026-08-07 17:15:57
- Spring Bootのテスト入門|@SpringBootTestとJUnitでの単体・結合テスト 2026-08-07 17:15:57
- APIキー取得方法 2026-08-07 17:15:56
- インストール方法(Windows版) 2026-08-07 17:15:56
- Java とは?言語仕様・JVM・主要フレームワーク一覧 2026-08-07 17:15:56
- 【PHPフレームワーク】Laravelの使い方 2026-08-07 17:15:56
- Scratch 作品の公開方法 2026-08-07 17:15:56
- Google OAuth 2.0 認証の実装方法 2026-08-07 17:15:56
- データベースとは?RDB / NoSQL / SQL の基礎 2026-08-07 17:15:56
- インストール(eclipseプラグイン) 2026-08-07 17:15:56
- Spring Frameworkの使い方 2026-08-07 17:15:56
コメントを削除してもよろしいでしょうか?