windows 任务计划自动提交 笔记到github 、gitee

一、必须有个git仓库托管到git上。

这个就不用说了,自己在github或者码云上新建一个仓库就行了。

二、创建自动提交脚本

这个bat脚本是在windows环境下使用的。
注意:windows定时任务下 调用自动提交git前,必须先进入该git仓库目录,否则不会生效。

比如 我的笔记git仓库目录 是 D:\Note,则自动提交笔记到github 必须在 执行 git命令前 先进入当前目录

自动提交.bat

复制代码
d:	//盘符
cd Note //git仓库路径
// 执行下面代码前,必须先进入git仓库
git status
@echo off
git add .
git commit -m "更新"
git push
echo Succeed: %msg%
echo --------End!--------
//pause

自动拉取.bat

复制代码
d:
cd Note
// by Alexander Ezharjan
@echo off
git status
git pull
echo Succeed: %msg%
echo --------End!--------
//pause

因为我用另一个仓库来管理笔记中的图片,所以还有一个自动提交图片的

复制代码
e:
cd typora-img-master
cd typora-img
git status
@echo off
git add .
git commit -m "更新图片"
git push
echo Succeed: %msg%
echo --------End!--------
//pause

三、创建windows定时任务计划

右键打开计算机管理

右键文件夹 新建基本任务一步一步来即可。



完成,最后不要忘了 运行一下看看是否生效

相关推荐
Nejosi_念旧1 小时前
git报错解决:ssh: connect to host github.com port 22: Connection refused
git·ssh·github
ReedFoley3 小时前
【笔记】动手学Ollama 第五章 Ollama 在 LangChain 中的使用 - Python 集成
笔记·langchain
大千AI助手6 小时前
GitHub Copilot:AI编程助手的架构演进与真实世界影响
人工智能·深度学习·大模型·github·copilot·ai编程·codex
xuanerya7 小时前
使用 SSH 方式克隆 GitHub 仓库没有权限解决办法
运维·ssh·github
Mr Sorry9 小时前
Non-stationary Diffusion For Probabilistic Time Series Forecasting论文阅读笔记
论文阅读·笔记
南猿北者10 小时前
Cmake学习笔记
笔记·学习·策略模式
码小文11 小时前
Altium Designer 22使用笔记(8)---PCB电气约束设置
笔记·嵌入式硬件·硬件工程·ad22
希尔伯特旅馆11 小时前
Tushare:量化投资数据获取
github
UserNamezhangxi13 小时前
kotlin 协程笔记
java·笔记·kotlin·协程
翻滚的小@强16 小时前
数据挖掘笔记:点到线段的距离计算
人工智能·笔记·数据挖掘