Skip to content

Instantly share code, notes, and snippets.

@Ketouem
Created January 27, 2016 09:28
Show Gist options
  • Select an option

  • Save Ketouem/74a0e3e5e4366e8ef42d to your computer and use it in GitHub Desktop.

Select an option

Save Ketouem/74a0e3e5e4366e8ef42d to your computer and use it in GitHub Desktop.

Revisions

  1. Ketouem created this gist Jan 27, 2016.
    7 changes: 7 additions & 0 deletions gitprojects.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    for file in */ ; do
    if [[ -d "$file" && ! -L "$file" ]]; then
    echo "$file is a directory, launching git commands.";
    cd $file && git checkout master && git reset HEAD --hard && git pull --rebase --prune;
    cd ..;
    fi;
    done