cmder slow issue(在較大git倉庫下相應緩慢)【轉】

cmder 是一款強大的命令行工具, 可以在windows 上執行一些Linux的常用指令,如 rm, ls, grep 等等(安裝full版本或獨立安裝git, 這些命令一般在git中). 很值得推薦. 不過如果系統中安裝了git, 且當前命令行文件夾中存在的git倉庫較大時候,輸入回車和執行一些指令就會比較慢. 以下是一個臨時的解決辦法. 我測試了還是效果比較明顯的. 

temperory solution:
comment these codes in local function git_prompt_filter() in clink.lua under cmder\vendor folder:

local git_dir = get_git_dir()
if git_dir then
	-- if we're inside of git repo then try to detect current branch
	local branch = get_git_branch(git_dir)
	local color
	if branch then
		-- Has branch => therefore it is a git folder, now figure out status
		local gitStatus = get_git_status()
		local gitConflict = get_git_conflict()
 
		color = colors.dirty
		if gitStatus then
			color = colors.clean
		end
 
		if gitConflict then
			color = colors.conflict
		end 
 
		clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..branch..")")
		return false
	end
end
 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章