windows git 的powershell 的几个坑

来源:互联网 发布:组策略 网络访问 编辑:程序博客网 时间:2024/06/05 05:11

1.  git log 运行后,光标处有时会出现<END> 或 :, 无法运行其他命令,必须ctrl + c 退出。其实这时是进入了page浏览模式, 按 q 退出即可。

2. git revert HEAD运行后出现gitpad的弹出框报错。这时因为没有设置默认编辑器。运行

git config --global core.editor "\"c:\Program Files\Notepad++\notepad++.exe\" %*"或
git config --global core.editor "'C:/Program Files/Vim/vim72/gvim.exe' --nofork '%*'"
即可设置默认编辑器(参考: http://stackoverflow.com/questions/10564/how-can-i-set-up-an-editor-to-work-with-git-on-windows)。


快捷git命令设置(C:\Documents and Settings\Administrato.gitignore) (http://gitimmersion.com/lab_11.html)

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