How can I Git ignore subfolders / subdirectories?
Use wildcards: Solution/*/bin/Debug Solution/*/bin/Release With version 1.8.2 of Git, you can also use the ** wildcard to match any level of subdirectories: **/bin/Debug/ **/bin/Release/
Use wildcards: Solution/*/bin/Debug Solution/*/bin/Release With version 1.8.2 of Git, you can also use the ** wildcard to match any level of subdirectories: **/bin/Debug/ **/bin/Release/
Use: public void listFilesForFolder(final File folder) { for (final File fileEntry : folder.listFiles()) { if (fileEntry.isDirectory()) { listFilesForFolder(fileEntry); } else { System.out.println(fileEntry.getName()); } } } final File folder = new File(“/home/you/Desktop”); listFilesForFolder(folder); The Files.walk API is available from Java 8. try (Stream<Path> paths = Files.walk(Paths.get(“/home/you/Desktop”))) { paths .filter(Files::isRegularFile) .forEach(System.out::println); } The example uses the try-with-resources … Read more
Easy with Boost.Filesystem: create_directories #include <boost/filesystem.hpp> //… boost::filesystem::create_directories(“/tmp/a/b/c”); Returns: true if a new directory was created, otherwise false.
Do the following: grep -Rnw ‘/path/to/somewhere/’ -e ‘pattern’ -r or -R is recursive ; use -R to search entirely -n is line number, and -w stands for match the whole word. -l (lower-case L) can be added to just give the file name of matching files. -e is the pattern used during the search Along … Read more
Use rmdir argument or config parameter: –rmdir Only used with the dcommit, set-tree and commit-diff commands. Remove directories from the SVN tree if there are no files left behind. SVN can version empty directories, and they are not removed by default if there are no files left in them. git cannot version empty directories. Enabling … Read more
As this answer shows up on top of google, i’m adding a java 7 nio solution for listing all files and directories, it is takes about 80% less time on my system. try { Path startPath = Paths.get(“c:/”); Files.walkFileTree(startPath, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { System.out.println(“Dir: ” + dir.toString()); return … Read more
OK, I’m not going to code the whole thing for you (what’s the fun in that?) but I’ll get you started. First, there are two ways to do the content comparison. The lazy/mostly right way, which is comparing the length of the files; and the accurate but more involved way, which is comparing a hash … Read more
To copy everything in a folder hierarchie Copy-Item $source $dest -Recurse -Force To copy the hierarchie you can try: $source = “C:\ProdData” $dest = “C:\TestData” Copy-Item $source $dest -Filter {PSIsContainer} -Recurse -Force To flatten a file structure you can try: $source = “C:\ProdData” $dest = “C:\TestData” New-Item $dest -type directory Get-ChildItem $source -Recurse | ` … Read more
The IPython documentation pages suggest that opening several different sessions of IPython notebook is the only way to interact with saved notebooks in different directories or subdirectories, but this is not explicitly confirmed anywhere. Yes, this is a current (temporary) limitation of the Notebook server. Multi-directory support is very high on the notebook todo list … Read more