gpt4 book ai didi

git - 如何获取当前仓库的名称和人员/组织以用于 .gitconfig?

转载 作者:太空狗 更新时间:2023-10-29 14:44:06 24 4
gpt4 key购买 nike

基本上我想做的是有一个方便的工具,我可以在其中说:

git 打开

这只会在您的浏览器中打开当前的 github 存储库。如果我能得到名称,我可以使用 https://github.com/{user or org}/{repo name} 的别名。

最佳答案

试试这个 bash 函数

对于 Linux:

function git-open-url(){
xdg-open `git config --get remote.origin.url`
}

对于苹果机:

function git-open-url(){
open `git config --get remote.origin.url`
}

关于git - 如何获取当前仓库的名称和人员/组织以用于 .gitconfig?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38840031/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com