获取github上托管的repo的git分支列表 [英] get list of git branches for a repo hosted on github

查看:263
本文介绍了获取github上托管的repo的git分支列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种命令行方式来获取Github托管的repo中可用的分支列表(无需在克隆中创建和运行命令)?

I尝试在显示分支列表和获取内容的url上使用curl。

解决方案

  git ls-remote  -  heads< repo-url> 

git ls-remote 的手册页。

例如

,git git的git仓库分支使用

  $ git ls-remote  -  heads git://github.com/混帐/ git.git 
121f71f0da1bc9a4e1e96be2c3e683191a82a354裁判/头/维护
f623ca1cae600e97cb0b38131fdd33e4fb669cf8裁判/头/主
8e148144574e6c6511b591286e44a677a260d760裁判/头/下一个
fcdb578342aeaf355c296026af08093b20aab9b4裁判/头/ PU
5321cb29c8f709669c5e4a04f502cd984623592c refs / heads / todo


Is there a command line way of getting the list of branches available in a repo hosted in GITHUB (without creating and running commands from within a clone)?

I tried using curl on the url that shows the branches list and getting the content.

解决方案

git ls-remote --heads <repo-url>

Man page of git ls-remote.

For example, to git the branches of git's git repo use

$git ls-remote --heads git://github.com/git/git.git      
121f71f0da1bc9a4e1e96be2c3e683191a82a354    refs/heads/maint
f623ca1cae600e97cb0b38131fdd33e4fb669cf8    refs/heads/master
8e148144574e6c6511b591286e44a677a260d760    refs/heads/next
fcdb578342aeaf355c296026af08093b20aab9b4    refs/heads/pu
5321cb29c8f709669c5e4a04f502cd984623592c    refs/heads/todo

这篇关于获取github上托管的repo的git分支列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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