git pullしてYou are not currently on a branch.というメッセージが出てしまいました。
対処したことを覚え書きとして残しておきます。
対象ツール・環境
- Git
- OS:Windows10
- コマンドプロンプトを使用
前提条件
前提条件:複数の環境で、masterブランチに対し作業を行っていた
発生事象と解決までの流れ
1.git pullしたところ、以下のようなメッセージが出現
> git pull
remote: Counting objects: XX, done.
Unpacking objects: 100% (XX/XX), done.
From https://XXXXX
XXXXXX1..XXXXXX2 master -> origin/master
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
2.メッセージに従ってコマンドを実行したがうまくいかず・・
> git pull origin/master master
fatal: 'origin/master' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
3.ブランチの一覧を確認したところ以下のような結果に
> git branch -vv
* (no branch, rebasing master) XXXXXX1 2. aaaaa
master XXXXXX2 [origin/master: behind 5] 1. bbbbb
→(no branch, rebasing master)に切り替わっている??
4.masterブランチをcheckoutして解決!
> git checkout master
5.ブランチ一覧を再度確認したところ、(no branch, rebasing master)は消えていました
> git branch -vv
* master XXXXXX2 [origin/master: behind 5] 1. bbbbb
原因
おそらくですが、git rebase -iしたこと