Objective Use the command line SVN client on Mac OS X
Subversion was built to be used with the command line subversion client (not the bastardized GUI clients that are being sold on the market right now).
As such my instructions are for the native command line subversion client “svn”
These instructions detail how to checkout code, create a commit/add script, and execute that script
- Start terminal
- Paste in commands below (replace “REPLACEME” with your username/password on third line, yes that period at the end line three is intentional), hitting enter after each command:
mkdir -p ~/Documents/svn/someproject cd ~/Documents/svn/someproject svn co https://svn.example.com/ --non-interactive --username REPLACEME --password REPLACEME --trust-server-cert .
Change or modify files in your finder at “Documents/svn/someproject” (do not replace with any files already in source control)
CREATE CHECK IN SCRIPT
You only need to do this once
- Open up your favorite text editor that can save files as plain text (Ex: TextWrangler, TextMate, BBEdit, SublimeEdit, etc)
- Paste this in:
#!/bin/bash SVN_PATH_TO_COMMIT='~/Documents/svn/someproject' SVN_USERNAME='REPLACEME' SVN_PASSWORD='REPLACEME' cd $SVN_PATH_TO_COMMIT svn add \ --non-interactive \ --trust-server-cert \ --no-auth-cache \ --username $SVN_USERNAME \ --password $SVN_PASSWORD \ --force $SVN_PATH_TO_COMMIT/* \ --auto-props --parents --depth infinity -q svn ci --non-interactive \ --trust-server-cert \ --no-auth-cache \ --username $SVN_USERNAME \ --password $SVN_PASSWORD \ -m "auto commit"
- Replace “REPLACEME” with your username/password
- Save the file as “
- Switch Back to the terminal type in this command then hit enter:
chmod +x ~/Documents/svn/commit_files.sh
ADDING/CHECKING IN FILES
- Open Terminal
- Type this in and hit enter:
sh -x ~/Documents/svn/commit_files.sh