在git remote上撤消设置分支 [英] Undo set-branches on git remote

查看:76
本文介绍了在git remote上撤消设置分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前已设置我的git remote来限制要提取的分支:

I've currently set up my git remote to restrict which branches are fetched:

git remote set-branches myOrigin myBranch

这会将适当的条目添加到 .git/config :

This adds the proper entries to .git/config:

[remote "myOrigin"]
    fetch = +refs/heads/myBranch:refs/remotes/myOrigin/myBranch

现在我要撤消此操作,然后返回默认配置:

Now I want to undo this, and go back to the default configuration:

[remote "myOrigin"]
    fetch = +refs/heads/*:refs/remotes/myOrigin/*

如何在不手动修改 .git/config 的情况下执行此操作?我可以运行 git 命令吗?

How can I do this without manually modifying my .git/config? Is there a git command I can run?

推荐答案

只需使用带引号的星号:

Simply use quoted star:

git remote set-branches myOrigin '*'

这篇关于在git remote上撤消设置分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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