Created
December 8, 2016 21:24
-
-
Save holgerschurig/56a84a7347c1761f36785a21cc9bb6e3 to your computer and use it in GitHub Desktop.
How to stay up track changes in git projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Step 1: clone projects into directories with a leading "git-": | |
# | |
# git clone http://foo.org/foo.git git-foo | |
# git clone http://bar.org/bar.git git-bar | |
# | |
# Step 2: some hours/days/weeks later, run this script: | |
# | |
# ./update.sh | |
# | |
# Step 3: profit! | |
for i in git-*; do | |
( | |
LOGFILE=${i#git-}.diff | |
echo "---> $i" | |
test -f $LOGFILE && continue | |
cd $i | |
git pull 2>&1 | |
git log --reverse -p ORIG_HEAD..HEAD | tee ../$LOGFILE | |
test -s ../$LOGFILE || rm -f ../$LOGFILE | |
) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment