Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== SVN ====== **General Information** Subversion (svn) is a "free/open-source version control system". **Checklist** * Distro(s): Any * Package: svn installed ---- ====== Create ====== Create a working directory space. ---- ===== Checkout Repo ===== Checkout creates a local copy of the repo. Checkout command <code bash> svn checkout URL </code> Shortcut <code bash> svn co URL </code> ---- ====== Modify ====== Make changes to a repo. ---- ===== Update ===== Update changes from the repo to your local copy. <code bash> svn update </code> ---- ===== Add File ===== Add a new file/directory to the repo. New file only gets pushed to the repo copy upon commit. - Create a new file/directory locally - Add the file with svn<code bash>svn add mynewfile</code> - Commit the added file to the repo<code bash>svn commit -m "Adding a new file to the project." mynewfile</code> ---- ===== Delete File ===== Delete a file from the working copy. The file will be removed from the repo upon commit. - Delete file via svn<code bash>svn delete mynewfile</code> - Commit the deletion to remove from the repo<code bash>svn commit -m "removing mynewfile." mynewfile</code> ---- ===== Move File ===== Move or rename a file. File is changed in the repo upon commit. - Move/rename a file<code bash>svn move oldfilename newfilename</code> - Commit move/rename<code bash>svn commit -m "Renaming my file" newfilename</code> ---- ===== Commit ===== A commit saves changes to the repo. Commit command <code bash> svn commit -m "my changes description" </code> ---- ===== Cleanup ===== Keep your working directory clean by listing and/or removing untracked files. List untracked files<code bash>svn status --no-ignore | grep '^?' | awk '{print $2}' | xargs -I{} ls -l '{}'</code> \\ **WARNING**: The following could remove work in progress! Remove untracked files<code bash>svn status --no-ignore | grep '^?' | awk '{print $2}' | xargs -I{} rm -fv '{}'</code> ---- ====== Inspect ====== View status and logs. ---- ===== Diff ===== Show the differences between your working copy and the repo copy. <code bash> svn diff myfilename </code> ---- ===== Status ===== Show the status of the file(s) in the working copy. <code bash> svn status PATH </code> Show the character codes for various statuses <code bash> svn help status </code> ---- ===== Log ===== View logged commits. <code bash> svn log PATH </code> \\ View diff of a specific logged revision <code bash> svn log --revision r101 --diff </code> ---- linux_wiki/svn.txt Last modified: 2019/05/25 23:50(external edit)