Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nucklearproject/4028653 to your computer and use it in GitHub Desktop.

Select an option

Save nucklearproject/4028653 to your computer and use it in GitHub Desktop.

Revisions

  1. nucklearproject revised this gist Nov 7, 2012. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions Recursively add .gitignore files to empty dirs
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Recursively add a .gitignore file to all directories
    # in the working directory which are empty and don't
    # start with a dot. Helpful for tracking empty dirs
    # in a git repository.
    for i in $(find . -type d -regex ``./[^.].*'' -empty); do touch $i"/.gitignore"; done;
    # Recursively add a .gitignore file to all directories
    # in the working directory which are empty and don't
    # start with a dot. Helpful for tracking empty dirs
    # in a git repository.

    find . -type d -regex ``./[^.].*'' -empty -exec touch {}"/.gitignore" \;
  2. @justinfrench justinfrench revised this gist Oct 22, 2008. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions Recursively add .gitignore files to empty dirs
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,4 @@
    # start with a dot. Helpful for tracking empty dirs
    # in a git repository.

    for i in $(find . -type d -regex ``./[^.].*'' -empty); do
    touch $i"/.gitignore";
    done;
    for i in $(find . -type d -regex ``./[^.].*'' -empty); do touch $i"/.gitignore"; done;
  3. @justinfrench justinfrench created this gist Oct 22, 2008.
    8 changes: 8 additions & 0 deletions Recursively add .gitignore files to empty dirs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # Recursively add a .gitignore file to all directories
    # in the working directory which are empty and don't
    # start with a dot. Helpful for tracking empty dirs
    # in a git repository.

    for i in $(find . -type d -regex ``./[^.].*'' -empty); do
    touch $i"/.gitignore";
    done;