Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何更改git bash进入远程的默认分支 #55

Open
LghLcxLjxLxb opened this issue Jan 15, 2024 · 3 comments
Open

如何更改git bash进入远程的默认分支 #55

LghLcxLjxLxb opened this issue Jan 15, 2024 · 3 comments

Comments

@LghLcxLjxLxb
Copy link

image

本地进入git bash后,总是自动就进入了远程的master分支,我想切换到main主分支,然后就出现了这样的报错,不太懂什么意思......

@andyhuang18
Copy link
Collaborator

这并不是远程的master分支,而是本地的master分支,早先git的默认主分支是master,而不是main。所以本地其实没有名字为main的分支,因此在checkout时会报错。

@7774596
Copy link

7774596 commented Jan 15, 2024

可能是本地现在还没main分支,你可以git branch看一下,然后git branch -m main把现在这个默认分支改成main

@LghLcxLjxLxb
Copy link
Author

嗯嗯,我又新建了一个分支再clone一下解决了,感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants