A version is a static copy of a script. Once a version is saved, it can no longer be modified, only deleted. This feature is used when you are working on a script that goes through many changes and iterations. Versions allow you to keep track of your changes. Furthermore, creating versions is required when you are writing a library. For more information, see Libraries.
Creating a version
In the script editor
Open the script that you are working on and follow the steps below to save a version of it:
- Select File > Manage Versions...
- Provide a description for the version and then click Save New Version to save the current script as a new version.
- Once the version is saved, it shows up at the top of the list of versions right below the description box:
Using clasp
clasp
is a command line tool that allows you create and manage Apps
Script projects from a terminal. You can also use it to create a new project
version. See the Command Line Interface using clasp
guide
for more details.
- Install
clasp
. - Determine your script project ID. You can find it by opening the script project in the Apps Script editor and selecting File > Project properties > Info.
- From the command line, run:
clasp pull
- From the command line, run: clasp version
Deleting a version
- Select File > Manage Versions...
- Click X to the right of a version to permanently delete it.