0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

リポジトリを追加する方法 & git pull時のエラーについて

Last updated at Posted at 2020-05-31

リポジトリ追加の際のcommandの操作について
いつも忘れてしまうのでメモです。

#環境

  • 作成済みのリポジトリを用意
  • ローカルに新しくディレクトリを作成してgit init後の操作

#リポジトリ追加コマンド

$git remote add origin 追加したいリポジトリ

#リポジトリ消去コマンド

$ git remote rm origin

#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

どのブランチにマージしていいかわからないという意味なので以下のコマンドを実行します。

$ git pull リポジトリurl master

これでマージできました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?