windows - Git:自动提交 Windows 文件夹的内容

标签 windows git version-control

我们的网络上有一个共享文件夹。有没有办法自动提交并将文件夹的更改(例如每小时)推送到远程 Stash 存储库? 谢谢。

最佳答案

有很多开源工具可以进行 git 自动提交。然而,它们解决的任务略有不同:在检测到更改后立即提交。

https://github.com/mvgrimes/git-autocommit

https://github.com/riddochc/git-autocommit

此外,您可以创建一个批处理文件并安排它每小时运行:

#!/bin/sh
cd path/to/your/project
git add --all
timestamp() {
  date +"at %H:%M:%S on %d/%m/%Y"
}
git commit -am "Regular auto-commit $(timestamp)"
git push

如果有人知道如何在批处理文件中插入时间戳,欢迎您编辑此答案。

关于windows - Git:自动提交 Windows 文件夹的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30310347/

相关文章:

c - SymFromAddr 与给定地址的调试器符号不匹配

python - 在 Windows 上的任务计划程序中计划并手动运行 .pyw 脚本

gitignore 我的 Windows 用户名

intellij-idea - Intellij Idea 实时模板

version-control - 我可以在 perforce 中安全地编辑重命名的文件吗

windows - 文件复制和重命名

windows - RN-42 断开 SPP 配置文件上的连接

git - 尝试让 Jenkins ssh 访问私有(private) github 存储库时权限被拒绝

git - Visual Studio 的 .gitignore 文件

svn - 为什么要使用SVN?那里有任何 stash 的专业人士(通过 GIT/Mercurial/Bazaar)吗?