Linux中经常使用git clone命令的朋友都知道,拉下来的项目放久了,可能忘记了它来自哪里,虽然我们可以通过名字去github搜索,但不一定是找到正确的。那么怎么才能知道这个项目来自哪个地址呢?
以下是最简单、直接、立刻能用的方法,1 秒查出这个 Git 项目来自哪个远程地址!
方法 1:直接查看(最常用)
进入你的项目文件夹,运行:
git remote -v
输出示例:
origin https://github.com/xxx/blender-open-mcp.git (fetch)
origin https://github.com/xxx/blender-open-mcp.git (push)
origin 后面那一串网址 就是你 git clone 下来的源地址。
方法 2:查看配置文件(不用命令)
进入项目目录,打开文件:
.git/config
里面会有:
[remote "origin"]
url = https://github.com/xxx/blender-open-mcp.git
url = 后面就是项目来源地址。
方法 3:只输出 URL(精简版)
git remote get-url origin
直接打印出源地址。
总结
最简单的方法,你只要在项目目录里输入:
git remote -v
马上就能看到这个项目是从哪里 clone 下来的!