Click on “Blue letters” to follow me
Akik Conscience still lives
Welcome to add wechat official account: Yulinjun
An overview
An article on the gti branch switch problem, everyone should have this kind of situation, is the latest code to compile git, found a bug, the latest code some validation problems point, and then want to back branch debugging analysis, finally returned to the latest branch, or git push the modified code to compile.
But have you ever run into this situation? I also printed the branch information through git log, and then used Git branch to switch to an older branch to compile the package under Yocto. When I switched back to the normal branch for Git pull, I was prompted with an error.
Log information is as follows:
You are not currently on a branch.
Please specify which branch you want tomerge with.
See git-pull(1) for details.
git pull
Google Baidu Bing search, I also found an article in StackOverflow similar to my problem, I used the method provided by them to operate, found that the code update problem can be solved.
As suggested, I will directly go to the designated branch for Git pull
The problem has been solved for the time being, but I still feel uncomfortable. Because the new approach only circumvents the problem, not solves it in depth. So I started reading articles to find a better solution.
Some people suggested that I push up existing branches and pull down. Others let me switch remote branches.
But they all failed. So sometimes what looks like a good answer may not be the answer to your question.
** Later I looked back at Branch myself, and ** at this point I saw a record of branch switches.
I’ll just switch over
Git pull succeeds
In fact, the final discovery of the problem is also very simple, at the beginning of the confusion, to find the answer, maybe you calm down to think about it, maybe you will have a better solution. For those interested in git manipulation, check out my previous Git article.
Git from installation to multi-account operation in one set
Git from installation to multi-account operation in one set
This is my share of the actual project git branch switch encountered problems and solutions, the process is practiced, if you have better ideas, welcome to share.