0%

Git Automatically

能够用命令行或者批处理的,尽量自动化,提高效率,时间就是生命…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@echo off
@title auto update blog articles and git push

set fileSource=D:\IPCreatorBlog\source
set fileDestination=C:\IPCreatorBlogGit\blog\source
set gitDir=C:\IPCreatorBlogGit\blog

cls

cd %fileDestination%
rd /s/q %fileDestination%
Xcopy /e %fileSource% %fileDestination%

cd %gitDir%
git add -v .
git commit -m "Update blog daily"
git push

pause
1
2
3
4
5
6
7
 user@LAPTOP-082RQVIH MINGW64 /c/IPCreatorBlogGit/blog (master)
$ **git config --global alias.blog '!git add . && git commit -m "blog update" && git push'**
user@LAPTOP-082RQVIH MINGW64 /c/IPCreatorBlogGit/blog (master)
$ **git blog**
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean

更多参考:
Windows批处理(cmd/bat)使用小记
批处理常用命令总结 - 批处理命令简介
Git批处理脚本
请问如何写一个批处理自动打开 gitbash,然后自动执行一系列git命令(windows平台)?
Chrome-启动参数

欢迎关注我的其它发布渠道