Undo set-branches on git remote

北战南征 提交于 2021-02-05 05:50:33

问题


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

git remote set-branches myOrigin myBranch

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/*

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


回答1:


Simply use quoted star:

git remote set-branches myOrigin '*'



回答2:


One of the solutions:

git config remote.myOrigin.fetch +refs/heads/*:refs/remotes/myOrigin/*


来源:https://stackoverflow.com/questions/47726087/undo-set-branches-on-git-remote

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!