Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从我的Xcode版本文件切换到它的github/gitlab web版本_Xcode_Github_Hyperlink_Gitlab - Fatal编程技术网

从我的Xcode版本文件切换到它的github/gitlab web版本

从我的Xcode版本文件切换到它的github/gitlab web版本,xcode,github,hyperlink,gitlab,Xcode,Github,Hyperlink,Gitlab,我经常使用Github和Gitlab cool line anchor特性(即:)与同事共享代码链接 我正在寻找一种快速从我的文件跳转到它的web版本的方法。有人知道执行此操作的技巧或扩展吗 如果有可能从终端完成,那就已经很好了 我为Github和BitBucker提供了一个很好的XCode扩展,现在可以与Gitlab一起使用:您可以使用这个(尚未)完美的脚本: if [ "$#" -ne 3 ]; then echo "Illegal number of parameters, usa

我经常使用Github和Gitlab cool line anchor特性(即:)与同事共享代码链接

我正在寻找一种快速从我的文件跳转到它的web版本的方法。有人知道执行此操作的技巧或扩展吗


如果有可能从终端完成,那就已经很好了

我为Github和BitBucker提供了一个很好的XCode扩展,现在可以与Gitlab一起使用:

您可以使用这个(尚未)完美的脚本:

if [ "$#" -ne 3 ]; then
    echo "Illegal number of parameters, usage: script file lineStart lineEnd";
    echo "Example : test.sh .travis.yml 12 16";
    exit 255;
fi

branch=`git rev-parse --abbrev-ref HEAD`;
repo=`git config --get remote.origin.url | sed 's/\.git//g'`;

echo $repo"/blob/"$branch"/"$1#L$2-L$3;
这样做。用法:

path/to/script.sh file lineStart lineEnd
如果要将其复制到剪贴板(因为我看到您在mac上),请将其管道复制到pbcopy:

path/to/script.sh file lineStart lineEnd | pbcopy
当然你可以把它包装成一个函数


旁注:要使用它,pwd必须是您的git回购的根。

采用相同的想法,但更强大: