Problems encountered when using git [Summary]


1. [Problem] Running the git branch command to view branches does not display

Question:
The operation process is as follows. Create an empty remote warehouse on github without creating new branches and files. Then, after git clone to the local area, create a new file in the local workspace, and then think about looking at the branches that have not been created remotely or locally. In this case, check which branches are there, and then use the commands git branch -v (view local branches), git branch -a (view local and remote branches), and there will be a situation where the branches cannot be viewed: Reason
The git branch command cannot see the branch
:

  • You must first submit the file to the local warehouse before you can use git branch to view the branch status.

Submit a version to the local warehouse, that is, the local branch can be viewed:
Check the branch after submitting the version to the local warehouse

2. [Problem]: After submitting the remote library, the head pointer points to a different position, and the prompt: checkout: moving from xxxxx

Insert image description here
to be solved. . .

3. [git error]: git push prompt error: failed to push some refs to “xxxxxx”

View the blog:
https://blog.csdn.net/weixin_42640280/article/details/127354978

4、

Guess you like

Origin blog.csdn.net/weixin_42640280/article/details/127148705