Skip to content

Instantly share code, notes, and snippets.

@PotcFdk
Last active May 15, 2018 10:29
Show Gist options
  • Save PotcFdk/012743605d35e3dc58bb139aaa3990f7 to your computer and use it in GitHub Desktop.
Save PotcFdk/012743605d35e3dc58bb139aaa3990f7 to your computer and use it in GitHub Desktop.

Revisions

  1. PotcFdk revised this gist May 15, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion repo-reset.cmd
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ svn cleanup && svn revert --recursive .
    goto END
    :NONE
    :; else
    echo This seems to be neither a git not an svn repository.
    echo This seems to be neither a git nor an svn repository.
    :; fi; if false; then
    :END
    :; fi
  2. PotcFdk revised this gist May 15, 2018. No changes.
  3. PotcFdk created this gist May 15, 2018.
    26 changes: 26 additions & 0 deletions repo-reset.cmd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    #!/bin/sh
    :; # This file runs on both Windows and Linux. / (c) PotcFdk, 2018
    :<<":GITRESET"
    echo off
    cls
    if not exist .git goto PRESVNRESET
    :GITRESET
    :; if [ -d .git ]; then
    echo Resetting working copy to origin/master...
    git fetch && git checkout master && git reset --hard origin/master && git clean -xdf
    :; elif [ -d .svn ]; then
    :<<":SVNRESET"
    goto END
    :PRESVNRESET
    if not exist .svn goto NONE
    :SVNRESET
    echo Resetting SVN working copy...
    svn cleanup && svn revert --recursive .
    :; elif false; then
    goto END
    :NONE
    :; else
    echo This seems to be neither a git not an svn repository.
    :; fi; if false; then
    :END
    :; fi