[英]Can I get the upstream remote branch by ruby-git
我正在使用ruby -git 来操作我的 Git 存储库。 我可以获取从远程分支结帐的本地分支,如何获取上游远程分支? 这是代码:
require 'Git'
repo = Git.open("xxxpath.git")
localbranch = repo.branches["localbranchnamexxx"]
与普通 git 相同的方式
remote_branch = repo.branches["origin/localbranchnamexxx"]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.