LoginSignup
0
0

More than 1 year has passed since last update.

GitHubの上流ブランチ設定

Last updated at Posted at 2022-06-25

背景

マージすべきブランチがわからないと言われる、
git pullgit pushするときに毎回gitのurlを指定しないと行けなくて、面倒だったから

現状

下記のようなエラーが出る、毎回urlを指定するのは面倒、

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=<remote>/<branch> master

解決方法

カレントブランチに upstream を指定する

$ git remote add origin <gitのURL>
$ git push -u origin master   

これで解決。

※master == main

0
0
0

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
0
0