跳转至

Git

CheetSheet

# 设置默认分支
git config --global init.defaultBranch master

# 空目录保持
# Ignore everything in this directory
*
# Except this file
!.gitignore


# 罗列发生过修改的文件
git diff --name-only START_COMMIT..END_COMMIT
# 去重
git show --pretty="format:" --name-only START_COMMIT..END_COMMIT | sort | uniq

自动提交

1
2
3
4
5
6
# 安装
sudo wget https://raw.githubusercontent.com/aisuhua/git-auto/master/git-auto -o /usr/local/bin/git-auto
sudo chmod a+x /usr/local/bin/git-auto

# 配置 crontab 自动提交
* * * * * /usr/local/bin/git-auto -d /opt/www/aisuhua.github.io -o -p
作者: aisuhua