switch workdir : git -C "${CURRENT_DIR}" pull
git initgit clone https://github.com/c332030/SpringBootgit remote add origin https://github.com/c332030/common-element-ui-ts
git remote remove origingit push
git push -u origin master
# 最好不要用,会重置远程仓库
git push --forcegit add 1.txt
# 添加所有文件
git add -A# -a 自动添加,不需要 git add
git commit -am "提交修改"
git commit -m "提交修改"
git commit index.html -m "提交修改"
删除文件夹,那么请在 git rm --cached 命令后面添加 -r 命令
git filter-branch --force --index-filter "git rm --cached -r --ignore-unmatch pcre" --prune-empty --tag-name-filter cat -- --all
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch zlib-1.2.11.tar.gz" --prune-empty --tag-name-filter cat -- --all
git log# 显示文件内容变更
git diff hash1 hash2
# 只显示文件名
git diff hash1 hash2 --stat导出
# 导出最新的
git archive -o ../latest.zip HEAD
# 导出某个版本
git archive -o ../latest.zip hash
# 导出某个版本的某个文件或目录
git archive -o ../latest.zip hash dir/file.md