11
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VSCodeとGitHub連携で"git add" returning "fatal: outside repository" error が出たときの対処方法

Last updated at Posted at 2022-02-03

##問題
VSCodeとGitHub連携をした後、
VSCodeからステージングをしようとすると、スクショの通り、
"git add" returning "fatal: outside repository"
とエラーがでました!スクリーンショット 2022-02-02 22.49.54.png

##対処方法
こちらのサイトに掲載されていた内容で解決。

  1. フォルダ名が日本語になっている
  2. Gitのバージョンが低い(更新されてない)

https://crestadesign.org/sd-vscode-github1/

ですが、**「フォルダ名が日本語になっている」**について見落としをしていたため、何時間も潰してしまいました...
以下、反省のメモ書きです...

フォルダ名はPATHも確認すべし!

(スクショでは諸事情でパス名を隠しているのですが、)
パス名が、以下のように日本語になっていたのが原因でした!
めっちゃケアレスミス!

/Dropbox/_案件ファイル/ガイドライン/test

####日本語がダメな理由
(UTF-8のファイルが多くなっているので、日本語名のファイル名を気にしていなかったのが盲点でしたね... )

MacとWindowsでは、
Macは「が」→「か゛」として保存するのに対し、
Windowsは普通に「が」なので、
Zipファイルなどに込めたファイルを開くと名前が表示されないなどの問題があるようです。

##フォルダ名は、極力「半角英数字」にする
MACとWindowsとLinuxでファイルパスに使える記号も違うそうなので、
**フォルダ名は、極力「半角英数字」**にするのが無難ですね。
勉強になりました!!!

11
1
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
11
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?