首页 > 解决方案 > Git .bash_profile - 带有 git grep 的函数无法正常工作

问题描述

我的 bash_profile 中有以下(减少的)功能

function gg()
{
    search=$1
    
    search=\"$search\"
    echo "git grep -i $search"
    git grep -i $search
}

我已将 "-quotes 添加到搜索变量中,因为搜索文字可以包含多个单词并且变量不再引用。回显是正确的(例如测试“谁在那儿” ---> git grep -i “谁在那里”),但我没有得到任何结果......

你有什么主意吗?

标签: bashgitgit-bash

解决方案


推荐阅读