Skip to content

Instantly share code, notes, and snippets.

@pfrozi
Last active September 23, 2020 13:18
Show Gist options
  • Save pfrozi/8441b138c2abf56b81a97c4d1cfd5811 to your computer and use it in GitHub Desktop.
Save pfrozi/8441b138c2abf56b81a97c4d1cfd5811 to your computer and use it in GitHub Desktop.
Create a SQL Server script with all new .sql files from branch_with_new_scripts
#!/bin/bash
script=scripts_complete.sql
rm -f $script
for item in $(git diff-tree --name-only --no-commit-id -r master branch_with_new_scripts | grep ".sql"); do
cat $item >> $script
echo >> $script
echo GO >> $script
echo >> $script
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment