是否有可能获得分支名称而不克隆或从git中提取? [英] Is it possible to get branch names without clone or pull from git?

查看:48
本文介绍了是否有可能获得分支名称而不克隆或从git中提取?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取git存储库的所有分支名称.目前,我克隆了存储库,然后将其放在本地计算机上.这是低效的,因为我只需要名称即可.

I want to get all branch names of a git repository. Currently, I clone the repository then get them on local machine. This is inefficient because all I need is names and nothing else.

我想知道是否可以这样做?如果是这样,我可以使用什么命令.

I wonder if it is possible to do that? If so, what command I can use.

推荐答案

在本地无需克隆即可键入(使用git

Locally, without cloning, you can type (using git ls-remote):

git ls-remote /url/of/the/upstream/repo

这将列出远程HEADS及其关联分支

That will list of the remote HEADS and their associated branches

这篇关于是否有可能获得分支名称而不克隆或从git中提取?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆