no branch 问题

时间:2023-01-23 14:32:58

现象如下:

lynn.feng:~/project/Git/M_MT6737_MP$ git branch -a
* (no branch)
a36_panasonic_l004
b36_panasonic_tmp
master

lynn.feng:~/project/Git/M_MT6737_MP$ git checkout master
kernel-3.18/drivers/input/touchscreen/mediatek/GT9XX_B36/gt9xx_driver.c: needs merge
error: you need to resolve your current index first

lynn.feng:~/project/Git/M_MT6737_MP$ git status
# Not currently on any branch.

该问题已经说的很明白了,有文件没有提交,所以git树无法统一,解决方法如下:

git reset --merge