6

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?

metacubed
  • 7,031
  • 6
  • 36
  • 65

2 Answers2

3

Simply use quoted star:

git remote set-branches myOrigin '*'
zigarn
  • 10,892
  • 2
  • 31
  • 45
1

One of the solutions:

git config remote.myOrigin.fetch +refs/heads/*:refs/remotes/myOrigin/*
ElpieKay
  • 27,194
  • 6
  • 32
  • 53