2016-02-26 165 views
2

我似乎在创建新的本地存储库时没有初始化主分支的git时出现问题。当我运行“git init”时,主分支似乎没有被创建。下面是从我的命令行Git init不会创建主分支

C:\Users\KJA\workspace\gitproblem>git init 
Initialized empty Git repository in C:/Users/KJA/workspace/gitproblem/.git/ 

C:\Users\KJA\workspace\gitproblem>git branch 

C:\Users\KJA\workspace\gitproblem>git branch mybranch 
fatal: Not a valid object name: 'master'. 

C:\Users\KJA\workspace\gitproblem> 

复制粘贴是否有混帐的窗户什么的最新版本中的错误?

回答

7

Git init创建一个没有任何提交的回购。

由于分支是一个指向提交,你可以直到你提交的东西都有分支机构。

+0

好...这是快:d我不知道它,但它看起来像你是对的:) –

+0

同意。也许你可以查看这个链接http://classic.scottr.org/presentations/git-in-5-minutes/了解更多关于如何在本地设置你的仓库的信息 – randombee