【发布时间】:2016-04-20 09:13:06
【问题描述】:
我在其中创建了新目录 test 和 CD
在其中创建新的存储库:
git init
创建一个文本文件 test.txt 和一个目录,其中包含另一个文本文件 mydir/newfile.txt :
echo "Hello" > test.txt
mkdir mydir
echo "hello" > mydir/newfile.txt
git add test.txt
git add mydir/newfile.txt
git commit
在这些步骤之后,当我想通过写作来建立一个分支时:
git branch new_branch
我有错误:
致命:不是有效的对象名称:'master'
【问题讨论】:
-
我怀疑您的存储库中没有任何提交。
git log显示什么? -
致命:你当前的分支'master'还没有任何提交
标签: git git-branch git-bash