Skip to content

Instantly share code, notes, and snippets.

@Laeeth
Created January 10, 2015 22:55
Show Gist options
  • Save Laeeth/e7a7f0de471a3c7a7eca to your computer and use it in GitHub Desktop.
Save Laeeth/e7a7f0de471a3c7a7eca to your computer and use it in GitHub Desktop.
remove cached git files
module gitrmcache;
import std.stdio;
import std.file;
import std.process;
int main(string[] args)
{
if (!((args.length==2) || (args.length==3)))
{
writefln("syntax is gitrmcache <path> [filespec]");
return 0;
}
if (args.length==3)
{
foreach(item;dirEntries(args[1],args[2],SpanMode.breadth))
{
auto callgit=execute(["git","rm","--cached",item]);
}
}
else
{
foreach(item;dirEntries(args[1],SpanMode.breadth))
{
auto callgit=execute(["git","rm","--cached",item]);
}
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment