Skip to content

Instantly share code, notes, and snippets.

@Unkn0wnCat
Created November 28, 2022 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Unkn0wnCat/35a9282de425a4715506856aa8c20385 to your computer and use it in GitHub Desktop.
Save Unkn0wnCat/35a9282de425a4715506856aa8c20385 to your computer and use it in GitHub Desktop.
FH Wedel SVN SetIgnore Script

Kevin's Amazing SVN Ignore Script

This script will probably only be of use to you if you study at the @fh-wedel and have PS2 (Programmstrukturen 2), or you go to another University which uses SVN for version control and has you write Java code where you're not allowed to commit either your workspace.xml or your out directory.

So any FH Wedel students, thank me later. :p

How to use?

Just put this script in your SVN root directory (e.g. ps2_26), and then run it. Make sure your working directory is also at the root of the SVN managed directory.

Wow Kevin, you're so amazing and handsome

I know, thanks.

#!/usr/bin/env bash
#
# svn_setignores.sh
# by Kevin Kandlbinder <kevin@kevink.dev>
#
# Sets SVN to ignore out/ and .idea/workspace.xml
# on all subdirectories.
FOLDERS="./*"
for d in $FOLDERS
do
if [ -d "$d" ]; then # Only work on directories.
echo "Working on ${d}..."
svn propset svn:ignore "out" $d
svn delete --keep-local $d/out
if [ -d "${d}/.idea" ]; then
echo "Working on ${d}/.idea..."
svn propset svn:ignore "workspace.xml" $d/.idea
svn delete --keep-local $d/.idea/workspace.xml
fi
fi
done
echo "All done, thank you for using Kevin's amazing SVN ignore script!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment