Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Phiên bản là bản sao tĩnh của một tập lệnh. Phiên bản giúp bạn theo dõi các thay đổi. Sau khi lưu một phiên bản, bạn sẽ không thể sửa đổi phiên bản đó. Sử dụng các phiên bản khi bạn đang làm việc trên một tập lệnh trải qua nhiều thay đổi và lần lặp lại. Các dự án tập lệnh có thể có tối đa 200 phiên bản.
Bạn phải tạo phiên bản khi viết một thư viện. Để biết thêm thông tin, hãy xem phần Thư viện.
Tạo phiên bản
Một phiên bản sẽ được tạo tự động khi bạn tạo một lượt triển khai mới. Bạn cũng có thể tạo một phiên bản mới từ một bản triển khai hiện có bằng cách thực hiện các bước sau:
Mở dự án tập lệnh của bạn.
Ở trên cùng, hãy nhấp vào Triển khai>Quản lý việc triển khai.
Chọn chế độ triển khai đang hoạt động để tạo phiên bản mới rồi nhấp vào biểu tượng Chỉnh sửa edit.
Trong mục Phiên bản, hãy chọn Phiên bản mới.
Nhấp vào Triển khai.
Xem phiên bản trước
Để xem một phiên bản đã tạo trước đó trong dự án tập lệnh, hãy làm theo các bước sau:
Trong dự án tập lệnh, hãy nhấp vào historyNhật ký dự án.
Trong phần Nhật ký dự án, hãy chọn phiên bản mà bạn muốn xem. Để xem nội dung mô tả của một phiên bản, hãy giữ con trỏ lên số phiên bản.
So sánh phiên bản trước với phiên bản hiện tại
Để so sánh một phiên bản đã tạo trước đó với phiên bản hiện tại hoặc phiên bản đầu, hãy làm theo các bước sau:
Trong dự án tập lệnh, hãy nhấp vào historyNhật ký dự án.
Trong phần Nhật ký dự án, hãy chọn phiên bản mà bạn muốn xem.
Bật chế độ Làm nổi bật những điểm thay đổi.
Tuỳ thuộc vào những thay đổi bạn đã thực hiện kể từ phiên bản đã chọn, danh sách tệp có thể chứa các điểm đánh dấu sau:
Bút dạ
Loại thay đổi
Mô tả
Đã thêm tệp
Tệp này mới có trong phiên bản hiện tại.
Đã xoá tệp
Tệp này không còn trong phiên bản hiện tại.
Đã sửa đổi tệp
Tệp này có những thay đổi trong phiên bản hiện tại mà không có trong phiên bản đã chọn. Để xem các thay đổi, hãy nhấp vào tên tệp.
Khôi phục một phiên bản
Trong dự án tập lệnh, hãy nhấp vào historyNhật ký dự án.
Bên cạnh phiên bản bạn muốn khôi phục, hãy nhấp vào biểu tượng more_vertTuỳ chọn khác>Khôi phục phiên bản này>Khôi phục.
Xoá phiên bản
Bạn có thể xoá vĩnh viễn các phiên bản nếu chúng không được một hoạt động triển khai đang hoạt động sử dụng. Để lưu trữ một bản triển khai hoặc thay đổi phiên bản mà một bản triển khai đang hoạt động sử dụng, hãy tham khảo bài viết Tạo và quản lý bản triển khai.
Xoá một phiên bản
Để xoá từng phiên bản, hãy làm theo các bước sau:
Trong dự án tập lệnh, hãy nhấp vào historyNhật ký dự án.
Bên cạnh phiên bản bạn muốn xoá, hãy nhấp vào biểu tượng more_vertTuỳ chọn khác>Xoá phiên bản này>Xoá.
Xoá nhiều phiên bản cùng lúc
Để xoá nhiều phiên bản cùng một lúc, hãy làm theo các bước sau:
Trong dự án tập lệnh, hãy nhấp vào historyNhật ký dự án.
Nhấp vào Xoá hàng loạt phiên bản. Một hộp thoại sẽ xuất hiện cho thấy danh sách các phiên bản mà bạn có thể xoá. Những phiên bản đang được một quy trình triển khai đang hoạt động sử dụng sẽ không có trong danh sách.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-04 UTC."],[[["\u003cp\u003eVersions in Apps Script are static copies of your script, allowing you to track changes and revert to previous states if necessary.\u003c/p\u003e\n"],["\u003cp\u003eCreating versions is essential for libraries and projects undergoing frequent modifications, providing a history of your script's development.\u003c/p\u003e\n"],["\u003cp\u003eYou can easily create, view, compare, and delete versions within your Apps Script project using the provided steps.\u003c/p\u003e\n"],["\u003cp\u003eA maximum of 200 versions can be stored per script project, offering ample space for tracking your progress.\u003c/p\u003e\n"],["\u003cp\u003eVersions in use by active deployments cannot be deleted, ensuring that your deployed scripts remain functional.\u003c/p\u003e\n"]]],[],null,["A version is a static copy of a script. Versions let you track your\nchanges. Once you save a version, you can't modify it. Use versions when you're\nworking on a script that goes through many changes and iterations. Script\nprojects can have up to 200 versions.\n\nCreating versions is required when you're writing a library. For more\ninformation, see [Libraries](https://developers.google.com/apps-script/guides/libraries.html#creating-a-library).\n\nCreate a version\n\nA version is automatically created when you create a new deployment. You can\nalso create a new version from an existing deployment by taking the following\nsteps:\n\n1. Open your script project.\n2. At the top, click **Deploy** \\\u003e **Manage\n deployments**.\n3. Select the active deployment to create a new version for and click Edit edit.\n4. In the **Version** section, select **New version**.\n5. Click **Deploy**.\n\nView a previous version\n\nTo view a previously created version within your script project, take the\nfollowing steps:\n\n1. In your script project, click history **Project History**.\n2. Under **Project history**, select the version you want to view. To view the description of a version, hold the pointer over the version number.\n\nCompare a previous version to the current version\n\nTo compare a previously created version to the current, or head, version, take\nthe following steps:\n\n1. In your script project, click history **Project History**.\n2. Under **Project history**, select the version you want to view.\n3. Turn on **Highlight changes**.\n\nDepending on the changes you've made since the selected version, the files list\nmight contain the following markers:\n\n| Marker | Type of change | Description |\n|--------|----------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| | File added | This file is new in the current version. |\n| | File deleted | This file is no longer present in the current version. |\n| | File modified | This file has changes in the current version that weren't present in the selected version. To view the changes, click the file name. |\n\nRestore a version\n\n1. In your script project, click history **Project History**.\n2. Next to the version you want to restore, click more_vert **More actions** \\\u003e **Restore this version** \\\u003e **Restore**.\n\nDelete versions\n\nYou can permanently delete\nversions if they're not in use by an active deployment. To archive a deployment\nor change the version that an active deployment uses,\nrefer to [Create and manage deployments](/apps-script/concepts/deployments).\n\nDelete a version\n\nTo delete one version at a time, take the following steps:\n\n1. In your script project, click history **Project History**.\n2. Next to the version you want to delete, click more_vert **More actions** \\\u003e **Delete this version** \\\u003e **Delete**.\n\nDelete multiple versions at once\n\nTo delete multiple versions at the same time, take the following steps:\n\n1. In your script project, click history **Project History**.\n2. Click **Bulk delete versions**. A dialog shows a list of versions that you can delete. Versions in use by an active deployment aren't included in the list.\n3. Select the versions to delete and click **Delete**.\n4. In the dialog, click **Delete**."]]