2020-06-26
プログラミングプログラミング

git ignoreでGITの管理下から除く方法

git ignoreでGITの管理下から除く方法

23歳でブログをはじめました。高卒→社会人→セブ島留学→スタバ→プログラミングという経歴で、過去の自分が知りたかった情報などを発信し、たくさんの人の役に立てるサイトを目指しています。web制作、お仕事依頼はコメント欄、又はtwitter DMからお願いします。

みなさんアプリケーション開発を進める際、バージョン管理システムであるGITを使用しているかと思います。
今回はgitの管理下に置きたくないファイルが存在する場合に使用するコマンドについて僕自身のアウトプット含め、お話しようと思います。

git ignoreってなに?

GITの管理対象から外したいファイルを指定するファイルのこと。
gitの管理対象から外したい情報といえば
・環境変数など個人情報がが記載されたファイル
・セキュリティ上、誰にも共有してはいけないファイル

実際にgit ignoreを使ってみる

gitignoreにて
管理させたくないファイルは
hoge.html

管理させたくないディレクトリは
hoge/
末尾に/をつけるのがポイント


例えば、他人に知られてはいけない内容のseacrets.ymlは
config/secrets.yml
と記述することで、管理の対象から除いてくれます。

ただ、一度gitの管理下に置かれたファイル・フォルダは後からgitignoreに記述しても効果は適用されません。

後からgitignoreに記述した場合の対処法

一度管理下に置いたものをgitignoreに後から追記をしても、監視下には置かれません。
その際は、ターミナルでアプリケーションのディレクトリに移動した後、

git rm --cached  [ファイル名]と入力をしてあげれば大丈夫です。

以上です!

What’s a Rich Text element?

The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.

Static and dynamic content editing

A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.

お問い合わせありがとうございます。
お返事にお時間をいただく場合がございます。
エラーが発生しました。もう一度やり直してください。
目次