LoginSignup
0
0

More than 3 years have passed since last update.

【Linux・GCP】Gitコマンド使った時に出たエラー対処した件

Posted at

https://www.topgate.co.jp/gcp04-google-compute-engine-run-application
ここをやろうとした時に対処した。

【参考サイト】
git initコマンドの使い方:https://www.sejuku.net/blog/71268

【1】
Initialized empty Git repository in
上記はOKだった時の表示。

【2】
git commitした時に以下のエラーが出た。
以下のエラーがでた
git commit -m “Initial Commit”
error: pathspec 'Commit”' did not match any file(s) known to git.

https://teratail.com/questions/161970
こちらを参照。

ダブルコートではなく、シングルでいけばOK

【3】
以下のエラーがでた
git commit -m 'Initial Commit'

*** 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 '@')

*はマスクした部分

https://qiita.com/Taylor-U/items/3f329895766e613b3acf
ここで解決した。

要は、gitコマンドに関する設定をしていなかった。

https://note.nkmk.me/git-config-setting/
ここで設定確認、変更ができるみたい。

git config -l
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true

たしかに、これしか出てこなかった。
なので、設定し、add ,commitしなおしたら行けました。

git add .
git commit -m 'Initial Commit'
[master (root-commit) bb4b386] Initial Commit
5 files changed, 84 insertions(+)
create mode 100644 .gitignore
create mode 100644 README.md
create mode 100644 app.yaml
create mode 100644 main.py
create mode 100644 main_test.py

======

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0