LoginSignup
0
1

More than 3 years have passed since last update.

gitでローカルにHEADが存在しない時の対処方法

Last updated at Posted at 2019-09-02

以下のような手順で、remote addしたローカルディレクトリにHEADが存在しませんでした。

  1. サーバ側でベアリポジトリを作成
  2. 開発環境のローカルでファイルを作成
  3. git init,add,commit
  4. git remote add ...
  5. git push origin master
$ git branch -a
* master
  remotes/origin/master

orign/HEADが存在しない状態になります。
なので、以下の設定を行います。

$ git remote set-head origin master

確認

$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
0
1
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
1