0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Gitに追跡されないローカルフォルダを作成する

Posted at

Gitに追跡されない(git add .してもステージングされない)フォルダの作り方。
ローカルリポジトリに自分専用の検証用ファイルを置きたい時などに使う。

作り方

  1. 追跡対象外にしたいローカルフォルダを作成する
    • フォルダ名は何でもOK
  2. 作成したフォルダの中に「.gitignore」という名前の空のテキストファイルを作成する
  3. .gitignore をテキストエディタを開き、*だけ入力して保存する
    .gitignore
    *
    

結果

以下のようにローカルフォルダの中身がGitに監視されなくなる。
image.png
※フォルダ自体は追跡対象だが、中のファイルが全て対象外の場合はステージングされない。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?