If you want to ensure that a file type is ignored on a long term basis, then you can either use the ignore list detailed in the previous Time for Action
, or, to ignore a file type across all Subversion projects accessed via this particular client, then you should add the file to the client's Global Ignore list:
Time for action - using the global ignore list
- Bring up the TortoiseSVN context menu and select Settings.
- In the General section of the Settings - TortoiseSVN window which appears, add the file type or filename that you wish to ignore to the end of the list in the Global ignore patterns box (patterns are separated with a space):
- Click OK.
What just happened?
You have just added a file to the global ignore list--this list is used by the copy of TortoiseSVN on your machine. Any files included in the list will be ignored when you make a commit to any Subversion project. The global ignore list is specific to your client (TortoiseSVN is not the only client that has a global ignore list, other clients use it too, but it is not something that is sent to the server or shared with other members of your team), so other developers using other computers may have different settings and may ignore different files to you.
The ignore list uses Unix-style wildcards to match filenames:
- * : This wildcard matches any string of characters--including empty strings and spaces
- ? : It matches any single character
- [...] : This matches any one of the characters contained within the brackets--for example [A-Dprz] would match the upper case characters A, B, C, or D, and the lower case characters p, r, and z
Keeping your working copy up-to-date
You should periodically update your working copy to make sure that you have the latest version of any files that you are working on. This ensures that you are working with the latest version of the source code, and are not wasting your time working on code that has been altered or fixing bugs that have already been fixed.
If you have been following all of the Have a go hero sections, your main working copy is most likely out-of-date right now, because your artist has changed some artwork and committed the new art files to the server.
Time for action - updating your working copy
- To update your entire working copy, right-click inside the folder, and select SVN Update (You can update only specific files or folders by selecting them, then right-clicking on them. Developers probably wouldn't want to do this, but it is still a useful feature. An artist working remotely may choose to update only specific assets to save bandwidth.):
- An update window will appear, listing files which were added, removed, merged, or updated:
What just happened?
You have just updated your local working copy with any changes that have been made recently and submitted to the Subversion server. This is useful because it allows you to stay up-to-date with the work being done by your colleagues.
Using the repository browser
There may be some cases where you do not want to check out a working copy, but would prefer to perform actions directly on the repository. This is not advisable for routine development work, but can be useful in some instances. The Repository Browser allows you to explore a large project's file structure without checking out the entre project's directory structure. It also allows you to view revision logs and blame, and download unversioned copies of files quickly and easily.
The repository browser is intuitive and easy to use.
Time for action - using the repository browser
- To access the repository browser, simply right-click anywhere in an Explorer window and select TortoiseSVN | Repo Browser.
- The Repository Browser window will appear, as shown:
- The Repository Browser works in the same way as Windows Explorer--you can double-click on a folder to expand it. To get more information about a file, right-click on the file you are interested in--you will see several options:
- The Open and Open with... options allow you to open the file to view or edit its contents. The Show log, Revision graph, and Blame... options allow you to view information about the changes that have been made to the file.
What just happened?
You have just interacted directly with the repository. Remember that the Repository Browser allows you to work with the files stored on the repository--not your working copy. So, if you delete or rename a file using the Repository Browser, it will be removed from the current version on the repository and therefore be removed from other people's working copies next time they update them.
The Repository Browser is a useful tool for viewing the directory structure of a project and looking at revision histories. However, you should not make a habit of altering files by accessing the Subversion server directly. In most cases, it would be better to make the changes on your local copy, and then check them in.
In this article, you used TortoiseSVN to perform some of the more common day-to-day version control tasks--checking out a working copy, making changes, and checking those changes in.
Specifically, we covered:
- Checking out a working copy
- Using the checkout depth feature to check out only the parts of the repository that you need to work on
- Checking in your changes
- Excluding items from a commit
We also touched base on some of TortoiseSVN's other features, including file locking, commit log messages, and the repository browser.