我在Windows 10机器上安装了VS Code(版本:1.12.1),之后安装了Git(版本:2.13.0.windows.1)。
然后:
以下是Git Log输出:
我创建了一个Asp.Net项目(图1)
我在VS Code中打开它,进入源代码控制,点击初始化存储库(图2)
我尝试提交更改(图3)。
- 然后我看到了这个错误消息(图4)。
- 然后我确保git是提供者(图5)
- 我去了settings.json并覆盖了git路径(图6),默认情况下它设置为null。但这并没有解决问题。我从头开始创建另一个应用程序,仍然显示相同的错误消息。
以下是Git Log输出:
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