Skip to content

Instantly share code, notes, and snippets.

@tw-Frey
Last active December 8, 2021 07:49
Show Gist options
  • Select an option

  • Save tw-Frey/b6c564c097a2b850be40f6aa512fed1d to your computer and use it in GitHub Desktop.

Select an option

Save tw-Frey/b6c564c097a2b850be40f6aa512fed1d to your computer and use it in GitHub Desktop.
計算 git commit 數

Windows 版

for /f "tokens=*" %i in ('git ls-files') do @(
  for /f %j in ('git log --oneline "%i" ^| find /c /v ""') do @echo "%j", "%i"
) >> git-ls-files-log-count-commits.txt
@tw-Frey
Copy link
Copy Markdown
Author

tw-Frey commented Dec 8, 2021

因為使用中文
會有一些亂碼問題

例如
cmd 無法顯示中文

可以參考 在命令提示視窗(Command Prompt)顯示UTF-8內容

image
image

使用

chcp 65001

@tw-Frey
Copy link
Copy Markdown
Author

tw-Frey commented Dec 8, 2021

因為使用中文
會有一些亂碼問題

例如
git status/log
中文路徑顯示成 utf-8 編碼編號 (或者稱為亂碼)

可以參考 GIT - 中文亂碼的問題

image

使用

git config --global core.quotepath false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment