FogBugz can be set up to work together tightly with most source control systems. When you commit a bug fix to source control, you simply type the case number that you're fixing. The integration scripts see this and create bidirectional links:
The benefits:
The exact mechanism for entering a case number when you commit changes depends on your source control system.
Before you can start using source control integration, you will need to make a few configuration changes to FogBugz and your source control system so they can talk to each other.
If you don't already have source control, Fog Creek Software highly recommends Subversion. It's free, and available from http://subversion.tigris.org/. On all but the largest projects, it works just as well as more expensive source control systems and is extremely reliable.