Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save lionslair/5d8d74e7efb9c1cfdd804c11e12454bf to your computer and use it in GitHub Desktop.

Select an option

Save lionslair/5d8d74e7efb9c1cfdd804c11e12454bf to your computer and use it in GitHub Desktop.

Revisions

  1. @mnem mnem renamed this gist Dec 26, 2011. 1 changed file with 1 addition and 1 deletion.
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/bash

    ################
    # Uncomment if you want the script to always use the scripts own
    # Uncomment if you want the script to always use the scripts
    # directory as the folder to look through
    #REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    REPOSITORIES=`pwd`
  2. @mnem mnem renamed this gist Dec 12, 2011. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion update.sh → git-fetch-pull-all-subfolders.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,10 @@
    #!/bin/bash

    REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    ################
    # Uncomment if you want the script to always use the scripts own
    # directory as the folder to look through
    #REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    REPOSITORIES=`pwd`

    IFS=$'\n'

  3. @mnem mnem revised this gist Dec 6, 2011. 1 changed file with 13 additions and 7 deletions.
    20 changes: 13 additions & 7 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -6,14 +6,20 @@ IFS=$'\n'

    for REPO in `ls "$REPOSITORIES/"`
    do
    if [ -d "$REPOSITORIES/$REPO" ]; then
    cd "$REPOSITORIES/$REPO"
    if [ -d "$REPOSITORIES/$REPO" ]
    then
    echo "Updating $REPOSITORIES/$REPO at `date`"
    git status
    echo "Fetching"
    git fetch
    echo "Pulling"
    git pull
    if [ -d "$REPOSITORIES/$REPO/.git" ]
    then
    cd "$REPOSITORIES/$REPO"
    git status
    echo "Fetching"
    git fetch
    echo "Pulling"
    git pull
    else
    echo "Skipping because it doesn't look like it has a .git folder."
    fi
    echo "Done at `date`"
    echo
    fi
  4. @mnem mnem created this gist Dec 6, 2011.
    20 changes: 20 additions & 0 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #!/bin/bash

    REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

    IFS=$'\n'

    for REPO in `ls "$REPOSITORIES/"`
    do
    if [ -d "$REPOSITORIES/$REPO" ]; then
    cd "$REPOSITORIES/$REPO"
    echo "Updating $REPOSITORIES/$REPO at `date`"
    git status
    echo "Fetching"
    git fetch
    echo "Pulling"
    git pull
    echo "Done at `date`"
    echo
    fi
    done