Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How best to develop Google Sheets scripts and Git versioning

I am new to developing Google Sheets scripts. I have code forked from krlaframboise/SmartThings and would like to make some additions and commit those to my Github fork. I can obviously edit in the sheet script editor and paste those back to my git repository but that doesn't seem ideal. What are some good patterns for developing Google Sheets scripts and tracking in Github?

like image 541
Cord Avatar asked Dec 19 '17 20:12

Cord


2 Answers

Best solution I've found is GAS Github Assistant.

It's a Chrome Extension that integrates with the Apps Script IDE and allows you to pull/push code from/to your repos at the click of a button.

It not only supports Github but Bitbucket as well.

UPDATE 1/30/2018

Apps Script now has a command-line interface called clasp that offers similar functionality.

like image 144
TheAddonDepot Avatar answered Nov 11 '22 16:11

TheAddonDepot


If your changes are data changes that should correspond to code changes then you should follow the pattern that good database administrators have use for years.

Make the updates with code as an upgrade script checked into source. You should also make a downgrade script that undoes the changes and check it in.

If making the changes programmatically is a headache, then make the two files simply contain instructions on how to make the data changes. Include an upgrade and downgrade instruction file with each major release.

like image 1
N-ate Avatar answered Nov 11 '22 16:11

N-ate