惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
月光博客
月光博客
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
人人都是产品经理
人人都是产品经理
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - Franky
The Cloudflare Blog
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
Jina AI
Jina AI
阮一峰的网络日志
阮一峰的网络日志
小众软件
小众软件
Last Week in AI
Last Week in AI

Allen Hua 的网络博客

由于 Linux 桌面没有一个好用的天气程序就写了一个跨平台的CheckitoutWeather 给 caesium-image-compressor 图片压缩程序构建了 Linux AppImage v2.8.5 最新版 debian13(debian trixie)安装了nvidia闭源驱动后从x11切换到wayland的方法 山间摩旅追风,偶遇一场绚烂晚霞 最近使用debian系统的一些心得 机械革命无界14Pro笔记本debian forky成功驱动内置扬声器和麦克风 记录 typecho 1.2.0 升级到 1.3.0 过程 开发了一款openwrt插件:文本剪贴板 解决机械革命笔记本内屏高刷240Hz闪屏问题 使用 Java 写了一个局域网端口扫描器 - Allen Hua 的网络博客 openwrt使用外置根extroot机制扩展根分区大小 - Allen Hua 的网络博客 将机场ss节点批量转换成ss字符串链接批量添加到passwall - Allen Hua 的网络博客 给机械革命钛钽plus换屏:NY2换成NZ2 - Allen Hua 的网络博客 记录一次pve宿主机和上面的debian虚机无故down机事件 - Allen Hua 的网络博客 给图床部署cdn腾讯云的edgeone并排查Cache-Control max-age 3600的问题 - Allen Hua 的网络博客 从高山草甸到徽派古村:武功山反穿与皖浙赣自驾行记 - Allen Hua 的网络博客 增程器就是充电宝?别被忽悠了 - Allen Hua 的网络博客 浦口龙虎巷扫街,记录人间真实 博客图片压缩方案更新|AVIF|WebP|MozJPEG|标准JPEG Windows 电脑使用 Obs Studio 录制各个网站视频/桌面画面教程 为typecho博客添加latex支持 新能源汽车之纯电车使用交流慢充和直流快充的充电损耗对比 2025年3月更新全国5A景区名录 2025最新查看小米/红米手机电池健康度和循环次数方法 完美解决 seafile FILE_SERVER_ROOT 配置导致的内网外网不能同时访问和上传下载的问题 纯css实现typecho博客文章文字spoiler剧透效果 我对Typecho Facile主题的一些修改,图片懒加载优化,样式定制 2024年8月我的宜昌 - 重庆 - 川西小环线自驾旅行分享 2022年打卡南京市区人防工程纳凉点 2024年带着A7C2+腾龙28-200 再次来到红山森林动物园
分享一个 git add、git commit、git push 的快捷工作流工具
Allen Hua · 2021-07-04 · via Allen Hua 的网络博客
阅读量:2081

warning: 这篇文章距离上次修改已过1787天,其中的内容可能已经有所变动。

20210704160904.png

gitpushworkflow

feature description: git add . and git commit -m and git push workflow

一个不是那么复杂的 git add .git commit -m 'xxx'git push 的工作流脚本工具。

工具:Click Me

Usage

1. in macOS or any Linux systems

cp linux-gitpush.sh to any folder you like, such as /path/of/linux-gitpush.sh

at current git repo's work dir, just run

bash /path/of/linux-gitpush.sh

2. in Windows

cp windows-gitpush.bat to any folder you like, such as D:\, after copying, this file's absolute path is should be D:\windows-gitpush.bat

at current git repo's work dir, and just run

d:\windows-gitpush.bat

Example

in macOS or Linux

this output is like this

huadekaideMBP:notes-2021 huadekai$ bash linux-gitpush.sh 

this a git push workflow in macOS or Linux, using a shell file

current time is: 2021-07-04 15:22:30

current work dir is: /Users/huadekai/Downloads/personal-projects/github/notes-2021

first step: git add .

second step: git commit -m 'xxxx'
[master b15a526] 2021-07-04 15:22:30 update
 1 file changed, 1 insertion(+), 16 deletions(-)
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 12 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 293 bytes | 293.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To github.com:hellodk34/notes-2021.git
   3c5905e..b15a526  master -> master

third step: git push. ending.

the end of the workflow.

in Windows

the output is like this

D:\repo\github\notes-2021>windows-gitpush.bat

this a git push workflow in Windows, using a bat file

current time is: 07/04/2021 Sun 15:19:31.45

current work dir is: D:\repo\github\notes-2021       

first step: git add .

Waiting for 0 seconds, press CTRL+C to quit ...

second step: git commit -m 'xxx'
[master 9e9da30] 07/04/2021 Sun 15:19:33.16 update
 3 files changed, 42 insertions(+), 13 deletions(-)

Waiting for 0 seconds, press CTRL+C to quit ...

third step: git push
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 16 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 918 bytes | 918.00 KiB/s, done.
Total 5 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
To github.com:hellodk34/notes-2021.git
   eddc27a..9e9da30  master -> master

the end of the workflow.

注意事项

  1. 默认 git add 的是当前本地工作区的所有已改动文件
  2. git commit -m,提交的 message 信息,默认是时间+update 字符串拼接出来的
  3. 使用 vscode 时,快捷键 control + shift + ` 默认新建一个终端,此时所在工作目录就是 git 项目的根目录,直接执行 bash /path/of/linux-gitpush.shd:\windows-gitpush.bat 即可
  4. Windows 下 git.exe 建议安装 Git Bash

end.