@Pkun

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

コマンド$git statusを入力 エンターした後、理解できない文字列が出てきます

解決したいこと

ここに解決したい内容を記載してください。

以下のような文が出てきました
warning: could not open directory 'Application Data/': Permission denied
warning: could not open directory 'Cookies/': Permission denied
warning: could not open directory 'Documents/My Music/': Permission denied
warning: could not open directory 'Documents/My Pictures/': Permission denied
warning: could not open directory 'Documents/My Videos/': Permission denied
warning: could not open directory 'Local Settings/': Permission denied
warning: could not open directory 'My Documents/': Permission denied
warning: could not open directory 'NetHood/': Permission denied
warning: could not open directory 'PrintHood/': Permission denied
warning: could not open directory 'Recent/': Permission denied
warning: could not open directory 'SendTo/': Permission denied
warning: could not open directory 'Templates/': Permission denied
warning: could not open directory 'スタート メニュー/': Permission denied
On branch master

No commits yet

Untracked files:
(use "git add ..."to include in what will be committed)
.bash_history
.bash_profile
.bashrc
.cache/
.docker/
.git-for-windows-updater
.gitconfig
.ssh/
.viminfo
.vscode/
3D Objects/
AppData/
Contacts/

その前にgitコマンドでイニシャライズしてるんですが、
$ git init
Reinitialized existing Git repository in C:/Users/yuuit/.git/

use "git add ←これってイニシャライズした時にできたgitファイルですか?

$git statusを入力した時に大量に出てきた
warning: could not open directory
の意味ってなんでしょうか?

分かる方、どうかよろしくお願いしますm(_ _)m

0 likes

3Answer

use "git add ←これってイニシャライズした時にできたgitファイルですか?

違います。その行はただのメッセージです。

git statusを入力した時に大量に出てきた warning: could not open directory の意味ってなんでしょうか?

書いてあるとおりディレクトリ(Windows でいうフォルダのこと)が開けないという意味です。理由は Permission denied、つまりフォルダを開いて読み取る権限が git になかったからです。

Windows には詳しくありませんが、一部のフォルダは互換性のために用意されていて、ユーザーには開く権限がないらしいです。
https://news.mynavi.jp/article/win81tips-104/

それらは git で管理すべきではないので無視してください。

3Like

Comments

  1. @Pkun

    Questioner

    ありがとうございます!少し理解できました(^ー^)
    ありがとうございます♪

これからいろいろなソフトウェア(プログラムやデータ)を開発・管理していくと思いますが、開発ソフトウェア(プロジェクト)毎に開発ディレクトリを作り、そのディレクトリで git init を実行してGitリポジトリを作ります。
Gitリポジトリ単位でGitHubに公開することができます。
ホームディレクトリ直下ではソース管理しませんので、ホームディレクトリに作られた .git ディレクトリは消してしまいましょう。

2Like

Comments

  1. @Pkun

    Questioner

    なるほどぉ!少し理解できました♪Gitリポジトリの概念も少し分かりました
    コメントありがとうございます(^ー^)

$git statusを入力した時に大量に出てきた
warning: could not open directory
の意味ってなんでしょうか?

「権限が無いためディレクトリを開けない」という警告です。


use "git add ←これってイニシャライズした時にできたgitファイルですか?

いいえ、違います。
ステージングされていないファイルがあるから
上記のコマンドを使うとできます、という旨のメッセージです。


No commits yet

Untracked files:
(use "git add ..."to include in what will be committed)
.bash_hist\ory
.bash_pro\file
.bashrc
.cache/
.docker/
.git-for-windows-updater
.gitconfig
.ssh/
.viminfo
.vscode/
3D Objects/
AppData/
Contacts/

なぜそうしたか理由は分かりませんが

$ git init
Reinitialized existing Git repository in C:/Users/yuuit/.git/

から見るに

C:/Users/yuuit/直下で
コマンドを実行したことが原因かと。

1Like

Comments

  1. @Pkun

    Questioner

    なるほどぉディレクトリを作ってそこでやってくれ!ってことですねお
    ?了解しました♪

Your answer might help someone💌