Use source control

The first time you save a project created from a template, you have the option of enabling source control. If you don’t have a Git or Subversion server setup, select “Create Git repository on” and choose My Mac from the pop-up menu. Otherwise, choose Add To New Server, and in the sheets that appear, provide the server information.

To check out an existing project in a repository, choose Source Control > Check Out, and provide the server information in the sheets that appear. Choose a server from the table or enter a server address in the text field. Click Next, enter your credentials, and click Next again. Choose a location for your working copy and click Download. If the download is successful, the Source Control menu items are enabled.

To see the files you modified in the navigator, click the Project navigator () and click the source control status icon () in the filter bar. The Project navigator shows only the files that have a source control status such as modified (M). You can use the filter bar to view the set of files you’re actively modifying.

To see the changes you’ve made to a file, select the file in the Project navigator, choose the version editor () in the toolbar, and choose an option from the pop-up menu. To compare file versions, choose Comparison. To find out who last changed each line in your file, choose Blame. To view the source control log for the file, choose Log.

If you choose Comparison, the editor compares the local revision with the last revision committed to source control. For each change, the version editor shows the line that changed and highlights the changes to the line. To compare the local revision to an older revision, choose the older revision from the jump bar on the right. To compare any two revisions, select them from the jump bars on the left and the right.

To save the changes you made to files, choose Source Control > Commit. In the sheet that appears, optionally review the changes and exclude or discard specific changes. Then enter a commit log message, optionally select “Push to remote,” and click the Commit button.

SEE ALSOConfigure source control management