致命无法在Git中锁定引用/权限被拒绝

审查了关于 SO 的相关文章,但没有成功。

我在 macOS 上:

安装 Rust OK:

rustup update nightly
rustup update stable
rustup target add wasm32-unknown-unknown --toolchain nightly

然后安装了这个:

XX-MacBook-Air-2 substrate-node-template % git clone -b v2.0.0 --depth 1 https://github.com/substrate-developer-hub/substrate-node-template
Cloning into 'substrate-node-template'...
remote: Enumerating objects: 46, done.
remote: Counting objects: 100% (46/46), done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 46 (delta 0), reused 29 (delta 0), pack-reused 0
Receiving objects: 100% (46/46), 69.55 KiB | 962.00 KiB/s, done.
Note: switching to '655bfdc6fc922d117849cbcf808ee5bf2dfa1d53'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

然后这个:

cd substrate-node-template/ 

和这个:

XX-MacBook-Air-2 substrate-node-template % git checkout -b my-first-substrate-chain 

fatal: cannot lock ref 'refs/heads/my-first-substrate-chain': Unable to create '/Users/patrickburns/substrate-node-template/.git/refs/heads/my-first-substrate-chain.lock': Permission denied

非常感谢有关如何解决此错误的任何想法。

回答

您遇到了权限问题。但是你没有说任何可以表明原因的东西。

我做了你所做的,就 Git 而言,并没有任何困难:

$ git clone -b v2.0.0 --depth 1 https://github.com/substrate-developer-hub/substrate-node-template
$ cd substrate-node-template/
$ git checkout -b br
Switched to a new branch 'br'

您不能这样做的事实表明您以某种方式将此存储库克隆到您没有权限的地方。但我们不能从这里告诉你,为什么会这样。


以上是致命无法在Git中锁定引用/权限被拒绝的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>