我刚刚发现我有几个旧的 Git 存储库在过去十年中没有进行过修改 - 并且这些不再被识别为 Git 存储库。
其中一个无法识别的存储库包含以下文件:
drwxr-xr-x 13 jleffler staff 416 Nov 20 2021 .git
-rw-r--r-- 1 jleffler staff 25 Nov 22 2015 .git/COMMIT_EDITMSG
-rw-r--r-- 1 jleffler staff 23 Oct 29 2015 .git/HEAD
-rw-r--r-- 1 jleffler staff 41 Nov 21 2015 .git/ORIG_HEAD
-rwxr--r-- 1 jleffler staff 137 Oct 29 2015 .git/config
-rw-r--r-- 1 jleffler staff 73 Oct 29 2015 .git/description
drwxr-xr-x 11 jleffler staff 352 Oct 29 2015 .git/hooks
-rwxr-xr-x 1 jleffler staff 452 Oct 29 2015 .git/hooks/applypatch-msg.sample
-rwxr-xr-x 1 jleffler staff 896 Oct 29 2015 .git/hooks/commit-msg.sample
-rwxr-xr-x 1 jleffler staff 189 Oct 29 2015 .git/hooks/post-update.sample
-rwxr-xr-x 1 jleffler staff 398 Oct 29 2015 .git/hooks/pre-applypatch.sample
-rwxr-xr-x 1 jleffler staff 1642 Oct 29 2015 .git/hooks/pre-commit.sample
-rwxr-xr-x 1 jleffler staff 1356 Oct 29 2015 .git/hooks/pre-push.sample
-rwxr-xr-x 1 jleffler staff 4951 Oct 29 2015 .git/hooks/pre-rebase.sample
-rwxr-xr-x 1 jleffler staff 1239 Oct 29 2015 .git/hooks/prepare-commit-msg.sample
-rwxr-xr-x 1 jleffler staff 3611 Oct 29 2015 .git/hooks/update.sample
-rw-r--r-- 1 jleffler staff 377 Mar 24 2017 .git/index
drwxr-xr-x 4 jleffler staff 128 May 3 2016 .git/info
-rw-r--r-- 1 jleffler staff 240 Oct 29 2015 .git/info/exclude
-rw------- 1 jleffler staff 59 May 3 2016 .git/info/refs
drwxr-xr-x 4 jleffler staff 128 May 3 2016 .git/logs
-rw-r--r-- 1 jleffler staff 0 May 3 2016 .git/logs/HEAD
drwxr-xr-x 3 jleffler staff 96 Oct 29 2015 .git/logs/refs
drwxr-xr-x 3 jleffler staff 96 May 3 2016 .git/logs/refs/heads
-rw-r--r-- 1 jleffler staff 0 May 3 2016 .git/logs/refs/heads/master
drwxr-xr-x 4 jleffler staff 128 May 3 2016 .git/objects
drwxr-xr-x 3 jleffler staff 96 May 3 2016 .git/objects/info
-rw------- 1 jleffler staff 54 May 3 2016 .git/objects/info/packs
drwxr-xr-x 4 jleffler staff 128 May 3 2016 .git/objects/pack
-r--r--r-- 1 jleffler staff 2024 May 3 2016 .git/objects/pack/pack-9f36e2555a3014c30b8ca6b3594b4c20aec9e723.idx
-r--r--r-- 1 jleffler staff 7200 May 3 2016 .git/objects/pack/pack-9f36e2555a3014c30b8ca6b3594b4c20aec9e723.pack
-rw-r--r-- 1 jleffler staff 98 May 3 2016 .git/packed-refs
.git/config
文件的内容是:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
运行
git status
产量:
$ git status
fatal: not a git repository (or any of the parent directories): .git
$
另一个仍被识别为存储库的目录包含文件:
drwxr-xr-x 15 jleffler staff 480 Jun 2 16:22 .git
-rw-r--r-- 1 jleffler staff 228 Oct 26 2017 .git/COMMIT_EDITMSG
-rw-r--r-- 1 jleffler staff 206 Oct 21 2017 .git/FETCH_HEAD
-rw-r--r-- 1 jleffler staff 23 Jan 18 2017 .git/HEAD
-rw-r--r-- 1 jleffler staff 41 Oct 21 2017 .git/ORIG_HEAD
-rw-r--r-- 1 jleffler staff 307 Jan 18 2017 .git/config
-rw-r--r-- 1 jleffler staff 73 Jan 18 2017 .git/description
drwxr-xr-x 12 jleffler staff 384 Jan 18 2017 .git/hooks
-rwxr-xr-x 1 jleffler staff 478 Jan 18 2017 .git/hooks/applypatch-msg.sample
-rwxr-xr-x 1 jleffler staff 896 Jan 18 2017 .git/hooks/commit-msg.sample
-rwxr-xr-x 1 jleffler staff 189 Jan 18 2017 .git/hooks/post-update.sample
-rwxr-xr-x 1 jleffler staff 424 Jan 18 2017 .git/hooks/pre-applypatch.sample
-rwxr-xr-x 1 jleffler staff 1642 Jan 18 2017 .git/hooks/pre-commit.sample
-rwxr-xr-x 1 jleffler staff 1348 Jan 18 2017 .git/hooks/pre-push.sample
-rwxr-xr-x 1 jleffler staff 4951 Jan 18 2017 .git/hooks/pre-rebase.sample
-rw-r--r-- 1 jleffler staff 544 Jan 18 2017 .git/hooks/pre-receive.sample
-rwxr-xr-x 1 jleffler staff 1239 Jan 18 2017 .git/hooks/prepare-commit-msg.sample
-rwxr-xr-x 1 jleffler staff 3610 Jan 18 2017 .git/hooks/update.sample
-rw-r--r-- 1 jleffler staff 13334 Jun 2 16:09 .git/index
drwxr-xr-x 4 jleffler staff 128 Nov 11 2018 .git/info
-rw-r--r-- 1 jleffler staff 240 Jan 18 2017 .git/info/exclude
-rw-r--r-- 1 jleffler staff 641 Nov 11 2018 .git/info/refs
drwxr-xr-x 4 jleffler staff 128 Nov 11 2018 .git/logs
-rw-r--r-- 1 jleffler staff 0 Nov 11 2018 .git/logs/HEAD
drwxr-xr-x 4 jleffler staff 128 Jan 18 2017 .git/logs/refs
drwxr-xr-x 3 jleffler staff 96 Nov 11 2018 .git/logs/refs/heads
-rw-r--r-- 1 jleffler staff 0 Nov 11 2018 .git/logs/refs/heads/master
drwxr-xr-x 3 jleffler staff 96 Jan 18 2017 .git/logs/refs/remotes
drwxr-xr-x 4 jleffler staff 128 Nov 11 2018 .git/logs/refs/remotes/origin
-rw-r--r-- 1 jleffler staff 0 Nov 11 2018 .git/logs/refs/remotes/origin/HEAD
-rw-r--r-- 1 jleffler staff 0 Nov 11 2018 .git/logs/refs/remotes/origin/master
drwxr-xr-x 4 jleffler staff 128 Nov 11 2018 .git/objects
drwxr-xr-x 3 jleffler staff 96 Nov 11 2018 .git/objects/info
-rw-r--r-- 1 jleffler staff 54 Nov 11 2018 .git/objects/info/packs
drwxr-xr-x 4 jleffler staff 128 Nov 11 2018 .git/objects/pack
-r--r--r-- 1 jleffler staff 8660 Nov 11 2018 .git/objects/pack/pack-d5c4ff545cf0c5c55c767d2d20a5a947fc9e980e.idx
-r--r--r-- 1 jleffler staff 117736 Nov 11 2018 .git/objects/pack/pack-d5c4ff545cf0c5c55c767d2d20a5a947fc9e980e.pack
-rw-r--r-- 1 jleffler staff 621 Nov 11 2018 .git/packed-refs
drwxr-xr-x 3 jleffler staff 96 Nov 20 2021 .git/refs
drwxr-xr-x 3 jleffler staff 96 Jan 18 2017 .git/refs/remotes
drwxr-xr-x 3 jleffler staff 96 Nov 11 2018 .git/refs/remotes/origin
-rw-r--r-- 1 jleffler staff 32 Jan 18 2017 .git/refs/remotes/origin/HEAD
.git/config
文件包含:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = [email protected]:jleffler/scc-snapshots
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
git status
的输出是:
$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
我不确定显着差异是什么。
我不知道这是否重要,但我现在在配备 Apple M2 Pro 芯片的 MacBook Pro 上运行,运行 macOS Sonoma 14.5。 创建存储库时,我使用的是配备 Intel 芯片的 MacBook Pro 机器。 我怀疑这是否重要,但我现在使用
zsh
作为我之前使用 bash
的 shell。
Git 的当前版本是
/usr/bin/git
,它报告版本“git version 2.39.3 (Apple Git-146)”。