aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/misc/sync-gist.sh
blob: 1208fe2c635cfa6ca571e0ad284f8bfce8d195fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/bash

set -o pipefail
set -e

repo=~/gist/b0d2e7e67aa50298fdf8111ae7466b56

while read -r commit; do

  cd $repo
  git checkout $commit
  message="$(git show $commit | sed -n '1,4 d; /^diff/ q; s/^    //p')"

  cd ~/git/Bash-Snippets
  cp $repo/gist gist/gist
  git add gist/gist && git commit -m "$message"
done

cd $repo
git checkout master