如何使用 Git 管理我的 greasemonkey 用户脚本(以便将它们托管在 GitHub 中)

How to manage my greasemonkey userscripts using Git (in order to have them hosted in GitHub)

我想使用 Git 以便于 my userscripts (21) 的开发。另外,我也希望将它们托管在 GitHub 中。 (在 windows 10 中使用 Greasemonkey 和 Firefox).

所以,我的问题是:使用 Git 管理我的用户脚本的建议方法是什么,以便将它们也托管在 GitHub 中?

我注意到许多用户脚本的两位作者的回购:@Mottie 和@jerone 他们在 GitHub 中托管了许多用户脚本, 但他们遵循不同的方法:
Mottie's userscripts are all located in the root folder of the repo (just the .js files, there are no subfolders), (screenshot)
jerone's userscripts are located each in its own subfolder in the repo (screenshot).

我的猜测是 Mottie 将他的所有用户脚本都放在同一个单独的文件夹(这是回购协议)中,并将它们 linkedgm_scripts文件夹,
而 jerone 只是 保留一个单独的文件夹 作为存储库,其中包含他的脚本副本,
或者他的回购 包含 gm_scripts 文件夹
(但是,jerone 的 .gitignore 不包含 gm_folder 中应该忽略的那些文件的条目,例如 .db.wal.shm, config.xml 等等。所以,我不确定是不是这样).

我(上面的用户称 @jerone) actually have two folders that I keep in sync: GreaseMonkey gm_scripts folder and checked-out repo 文件夹在不同的位置。

存在 GitHub 上的当前文件夹结构,因为我想在离线时 Userscripts.org 之前备份我的脚本。所以我只是从 gm_scripts 文件夹中复制粘贴了我的脚本(带有文件夹)。也因为我之前用过一些@require,所以放在对应的文件夹里。

我没有将我的 gm_scripts 文件夹链接到 git,因为每个用户脚本使用 git 分支。使用最新的 master 重新设置分支的麻烦是原因之一。另一个原因是您不能同时在两个功能分支上工作。

在处理修复或新功能时,我当然在 gm_scripts 文件夹中工作。当我对实时用户脚本更改感到满意时,我会在提交更改之前使用 WinMerge 将更改同步到我的结帐回购文件夹。

.gitnore文件在那里,因为我用Visual Studio来更新脚本,但我很久以前就改成了Atom