Skip to main content

常用命令

  • 重置提交的用户
git commit --amend --reset-author
  • 查看提交变更的文件
git show commit_id --name-only
  • 查看分支的远程 upstream
git config --get branch.branch_name.remote
  • 查看文件修改历史
# 查看文件提交历史(git lg /path/of/file)
git log --decorate=full --color=always --graph --date=format:'%Y-%m-%d %H:%M:%S' --pretty=format:'%Cblue %H%d - %ad - %an(%ae) - %s' /path/of/file
# 查看文件修改历史
git log -p /path/of/file