From 8d400d70f2b6dfbb7351216f4868e4b9b1ba3bf1 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 8 Oct 2018 10:57:27 +0800 Subject: [PATCH] test --- gitbak.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gitbak.sh diff --git a/gitbak.sh b/gitbak.sh new file mode 100644 index 0000000..cbd02af --- /dev/null +++ b/gitbak.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +path="$(cd $(dirname $0);pwd)" + +function upload() { + now_time=$(date '+%Y-%m-%d %H:%M:%S') + echo $path + cd $path + echo "[info] entering git path... $(pwd)" + git add -A + git commit -m "Time: $now_time" + git push origin +} + + +function main() { + upload +} + +main