今さらRails3メモ - 番外編その2: gitに入れてないファイルの洗い出し -
- 以下の内容を Rails.root/lib/tasks/git.rake に置く
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :git do | |
desc "list git-untracked files" | |
task :untracked do | |
sh 'git ls-files -o --exclude-from=.gitignore' | |
end | |
end |
- Rails.root/.gitignore に cache, tmp など除外したいファイルのパターンを追加
以上。
もっといい方があるような気もするけど、今のところ満足。
rake -s git:untracked | xargs git add
とか、まとめてできる。
More
Recent Posts
- » Bundler環境でIRBでもLSPでもドキュメントを利用する方法
- » Ruby 3.2と3.3のirb historyの扱いの違いと対処方法
- » Result型とRailway Oriented Programmingをめぐる旅
- » dry-operationのススメとエラー情報をViewまで持っていく方法の模索
- » aligach.netのRubyとViteをバージョンアップした
- » ViteRuby 3.7.0は起動方法のデフォルトがnpx経由になった
- » GmailからSpreadsheetとGoogle Driveへ書き出すGASライブラリを作った
- » 面倒くさがり屋のためのTypeScript環境
- » JavaScriptにも論理和代入なんてあったんだ
- » TypeScriptでpropertyを舐める処理が面倒くさい