windows - 在 Windows 上通过别名将 git hist 设置为 pretty-print 日志

标签 windows git powershell

这样做:

git config --global alias.hist 'log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short'

as mentioned在 Windows 机器上给我 这个错误:

usage: git config [options]

当我尝试运行 git hist 时。有什么建议为什么它不起作用吗?

最佳答案

我无法获取添加 hist 的命令git 的别名.但是我直接把它插入.gitconfig通常可以位于 "C:\Users\<login name>\" 的文件或 "C:\Documents and Settings\<login name>\" .

看我的片段.gitconfig文件,并记下要对 hist 所做的更改别名,以便它在 Windows 下工作正常。

[alias]
    co = checkout
    ci = commit
    st = status
    br = branch
    hist = !git --no-pager log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
    type = cat-file -t
    dump = cat-file -p

关于windows - 在 Windows 上通过别名将 git hist 设置为 pretty-print 日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23525959/

相关文章:

php - 在 Server 2012 上安装 WordPress 和 MySQL

windows - 如何在 Windows cmd 中打印文件的前 5 行

php - 让 composer update 从 git repo 获取最新版本

git - 有没有办法共享一个 git Remote ?

regex - Powershell 将单个字符串与多个正则表达式匹配?

java - 什么可以使 Java 应用程序平台依赖?

c++ - QVBoxLayout 什么时候重新计算布局?

git - 如何处理 GitFlow 和子任务

powershell - 如何使用 PowerShell 将当前日期计算为自 1601-01-01 以来的毫秒数

powershell - 换行符在 powershell 中不起作用,同时替换