Reputation: 83
The command git update-index --skip-worktree works great but only for the single files. Is there a way apply it to multiple folders?
Upvotes: 3
Views: 1082
Reputation: 9219
I resolved this by making a small ruby script, call it something like 'gitskip.rb'
#!/usr/bin/env ruby
Dir.foreach(Dir.pwd) do |filename|
next if filename[0] == '.' or filename == '..'
`git update-index --skip-worktree #{filename}`
puts "#{filename} skipped."
end
And run it from the directory you're in.
$ ruby gitskip.rb
Upvotes: 2