gpt4 book ai didi

git - Visual Studio Code : Error: Git Failed to execute

转载 作者:太空狗 更新时间:2023-10-29 13:03:44 31 4
gpt4 key购买 nike

我安装了 VS Code(版本:1.12.1),然后在 Windows 10 机器上安装了 Git(版本:2.13.0.windows.1)。 然后:

  1. 我创建了一个 Asp.Net 项目 (img 1)

  2. 我在 VS Code 中打开它,转到源代码管理并单击初始化存储库 (img 2)

  3. 我尝试提交更改 (img 3)。

  4. 我看到了这条错误消息 (img 4)。
  5. 然后我确定 git 是提供程序 (img 5)
  6. 我转到 settings.json 并覆盖 git 路径 (img 6),默认情况下它设置为 null。但这并不能解决问题。我从头开始创建了另一个应用程序,但显示了相同的错误消息。

Click here to see the screenshots, please

这是 Git 日志输出:

Using git 2.13.0.windows.1 from C:\Program Files\Git\cmd\git.exe
git rev-parse --show-toplevel
git rev-parse --show-toplevel
fatal: Not a git repository (or any of the parent directories): .git

fatal: Not a git repository (or any of the parent directories): .git

fatal: Not a git repository (or any of the parent directories): .git

git rev-parse --show-toplevel
fatal: Not a git repository (or any of the parent directories): .git

git init
git rev-parse --show-toplevel
git status -z -u
git symbolic-ref --short HEAD
git rev-parse master
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose
git show :../../AppData/Roaming/Code/User/settings.json
git status -z -u
git symbolic-ref --short HEAD
git rev-parse master
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose
git show :../../AppData/Roaming/Code/User/settings.json
git add -A -- .
git commit --quiet --allow-empty-message --file - --all

*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'COMPAQ@PREPARA12.(none)')

git config --get-all user.name
git show :../../AppData/Roaming/Code/User/settings.json
git status -z -u
git symbolic-ref --short HEAD
git rev-parse master
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose
git show :../../AppData/Roaming/Code/User/settings.json
git commit --quiet --allow-empty-message --file -

*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'COMPAQ@PREPARA12.(none)')

git config --get-all user.name
git show :../../AppData/Roaming/Code/User/settings.json
git status -z -u
git symbolic-ref --short HEAD
git rev-parse master
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose
git show :../../AppData/Roaming/Code/User/settings.json
git fetch
fatal: No remote repository specified. Please, specify either a URL or a
remote name from which new revisions should be fetched.

git fetch
fatal: No remote repository specified. Please, specify either a URL or a
remote name from which new revisions should be fetched.

git fetch
fatal: No remote repository specified. Please, specify either a URL or a
remote name from which new revisions should be fetched.

git fetch
fatal: No remote repository specified. Please, specify either a URL or a
remote name from which new revisions should be fetched.

git fetch
fatal: No remote repository specified. Please, specify either a URL or a
remote name from which new revisions should be fetched.

git commit --quiet --allow-empty-message --file -

*** Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'COMPAQ@PREPARA12.(none)')

git config --get-all user.name
git status -z -u
git symbolic-ref --short HEAD
git rev-parse master
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose

最佳答案

来自上面的评论:

从 Git 读取日志输出。配置您的用户电子邮件和用户名。一种方法是打开命令提示符。然后使用 cd FILEPATH 导航到您的文件夹。然后配置您的用户电子邮件和用户名。它可以全局配置或仅在当前 repo 中配置。全局配置

git config --global user.email "youremailaddress@example.com"

然后

git config --global user.name "Your Name"

关于git - Visual Studio Code : Error: Git Failed to execute,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43957922/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com