Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 37 lines (26 sloc) 0.939 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
@echo off

rem -------------------------------------------------------------
rem BackUp
rem -------------------------------------------------------------
rem Prepare Timestamp
set hour=%time:~0,2%
if "%hour:~0,1%" == " " set hour=0%hour:~1,1%

set min=%time:~3,2%
if "%min:~0,1%" == " " set min=0%min:~1,1%

set secs=%time:~6,2%
if "%secs:~0,1%" == " " set secs=0%secs:~1,1%

set year=20%date:~-2%

set month=%date:~3,3%
if "%month:~0,1%" == " " set month=0%month:~1,1%

set day=%date:~0,2%
if "%day:~0,1%" == " " set day=0%day:~1,1%

@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%

set backuptimestamp=%year%%month%%day%_%hour%%min%%secs% Time %time:~0,8%
echo Backing Up %DATE% %hour%:%min%:%secs%

SET /P msg=Enter Commit Message,will be attached to backup timestamp :

git add . &
git commit -am "Backup %backuptimestamp% %msg%" &
git push --all backup

echo Done.
pause
Something went wrong with that request. Please try again.