git init --bare test-repo.git
cd test-repo.git
(创建的文件夹中包含git-ish文件和文件夹)
git status
致命:此操作必须在工作树中运行(好的,所以我不能将git状态与纯repo一起使用;我想这是有意义的)
git branch
(没什么,看起来这个空的repo不包含任何分支。我必须从克隆的存储库中添加它们吗?)
cd ..
mkdir test-clone
cd test-clone
git clone ../test-repo.git
(我收到关于克隆空存储库的警告)
cd test-repo
(提示符更改为指示我在主分支上)
g
当我尝试更改分支时,我得到了这个错误。
我可能会在以下地址提供一些命令的信息:
/path/to/git/repo/.
根据命令:
git branch
我得到了以下输出
* V1.5
V2.0
master
当我尝试这个命令时
git checkout V2.0
我得到以下输出:
fatal: This operation must be run in a work tree
配置文件内容:
cat config
[core]
repositoryformatversion = 0
filemode = true
bare = tru
Introduction
为了检查git存储库的状态,可以从存储库的根发出git status。
C:\path\to\git_repositories\git_repo_1>git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
如果一个目录由多个(例如50个git存储库)组成
C:\path\to\git_repositories>dir
Directory of C:\pat