bash 使用绝对路径获取 Git repo url
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18388840/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Get Git repo url using absolute path
提问by Ionic? Biz?u
I can get the repository path running the following command in the repository folder (like it was suggested here):
我可以在存储库文件夹中运行以下命令来获取存储库路径(就像这里建议的那样):
git config --get remote.origin.url
How can I get the git repository url using an absolute path?
如何使用绝对路径获取 git 存储库 url?
Suppose that I am in another folder and I want to get the repository url from another folder, using an absolute path.
假设我在另一个文件夹中,我想使用绝对路径从另一个文件夹中获取存储库 url。
I tried this, but doesn't work.
我试过这个,但不起作用。
git config --get remote.origin.url --path /home/username/myFolder
回答by forivall
git --git-dir=/home/username/myFolder/.git config --get remote.origin.url