Using Source Control

=Using Source Control with GameMaker:Studio= Once you have everything setup correctly, GameMaker:Studio has it's own set of tools for working with Source Control.

Once your file has been added to your source control repository you will see that a new set of icons have been added to each resource on your resource tree. These are the GameMaker:Studio source control indicators and are used to give you a graphic representation of the versions of each of your resources and while working on your project will look a bit like this :



Obviously the exact icons you see will depend on your project and what you have been working on, but you still need to know what they all mean! The list below shows each one and explains their significance :


 * [[File:SC_Updated_Icon.png]] Updated : This shows that the resource is updated to the current version as stored in the repository.


 * [[File:SC_Added_Icon.png]] Added : This icon means that you have created a new resource and it has to be added into the repository. This will happen automatically when you save your progress.


 * [[File:SC_modified_icon.png]] Modified : When you change a resource in any way this icon will appear beside it to let you know that it is now different to the last version in the repository.


 * [[File:SC_notversioned_icon.png]] Not Versioned : if you see this icon it means that the resource is not recognised by the SVN Client and should therefore be added to the repository. There is an "add" command provided for this in the right-click menu from the resource tree.


 * [[File:SC_conflict_icon.png]] Conflict : if you get this icon it means there is a conflict between two resources. this can only usually happen when two or more people work on the same source and cannot be resolved through GameMaker:Studio. For that you will have to use your windows SVN Client to merge the two files or manually edit the *.gmx files.

You can now work on your game as normal, creating, changing and adding resources as necessary knowing that these changes are only being done to your local copy of the game, not the versioned copy stored in the repository. Now, that's fine for working on something, but what happens when you are happy with what you have done and want to store it in the repository? Or if you are on a team and want to see if someone has added a resource you need into the repository? Well, you have some new options in the resource tree right-click pop up menu which deal with source control :

As you can see these are the two most common actions that need to be performed :


 * Commit : This will commit the selected resource to the source control repository. If you have a folder selected then everyting in that folder will be commited, otherwise it will only commit the selected resource. When you commit something you will also be prompted to add a comment where you can briefly explain what you have added or changed, and this will then be stored along with the updated version of your project.


 * Update : This will update the selected resource (or resources if you have a folder selected) in your local copy of the project from the repository. Any changes, additions or conflicts will now show up in GameMaker:Studio.

Below those two actions, you also have a further sub-menu titled "Source Control". There are further actions that you can perform listed here :


 * Add : Normally you will have no need to use this action as GameMaker:Studio takes care of adding any new resources you create into the repository, but in some special cases it may be neccessary to manually add a resource into the repository. When this happens you will get the "Not Versioned" icon showing that you need to use this action.


 * Refresh Status : This simply refreshes the source control icons beside the resource (or resources if you have a folder selected) to reflect the current versioned status.


 * Revert : With this action you revert the selected resource, or resources if you have a folder selected, to the last version you have updated to from the repository.


 * Commit All : Commits everything into the repository. You will be prompted to save your work to the local copy before commiting, and then you will be shown a list of all items with checkboxes enabling you to selectively commit (or not) individual items.


 * Refresh All : This simply refreshes the status icons beside all the resources.


 * Revert All : Use this to revert all changes that you have done back to the last version you have updated to from the repository.


 * Update All : This will update all resources in your local copy of the project from the repository. Any changes, additions or conflicts will now show up in GameMaker:Studio.

It should be noted that there is no option to rename any resource as this is handled internally. So, when you have source control enabled and you rename (for example) a sprite, GameMaker:Studio will automatically change and update your local copy of the project as well as the repository without any need for your intervention.