{"thread":{"id":"59292","subject":"Get rid of `warning: refs/remotes/origin/master usually tracks refs/heads/master, not refs/remotes/origin/master`","startedAt":"2023-02-23T03:20:09Z","lastAt":"2023-02-25T21:46:20Z","messageCount":2,"participants":["Andry"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"472471","messageId":"942870379.20230223062101@inbox.ru","threadId":"59292","inReplyTo":null,"subject":"Get rid of `warning: refs/remotes/origin/master usually tracks refs/heads/master, not refs/remotes/origin/master`","fromName":"Andry","fromEmail":"andry@inbox.ru","sentAt":"2023-02-23T03:21:01Z","receivedAt":"2023-02-23T03:20:09Z","isPatch":false,"sender":{"key":"andry@inbox.ru","avatar":null},"body":"Hello Git,\n\nFound this issue and could find a solution.\n\nRepro steps:\n\n1. create a simple repo with only the master branch.\n2. `git pull origin *:*` to allocate all refs (no warnings)\n\nIf try to mirror the repo into the same remote:\n\n1. `git push origin --mirror`\n\nThen the remote counter part falls into the mirror state and reports the warning:\n\n1. `git pull origin *:*`\n\n```\nwarning: refs/remotes/origin/master usually tracks refs/heads/master, not refs/remotes/origin/master\nAlready up to date.\n```\n\nTried to delete all refs in the local and remote. But didn't work. Somehow the remove remember the state.\n\nIs there a way to unmirror the remote repository back?\n\n"},{"id":"472733","messageId":"1212192063.20230226004808@inbox.ru","threadId":"59292","inReplyTo":"942870379.20230223062101@inbox.ru","subject":"Re: Get rid of `warning: refs/remotes/origin/master usually tracks refs/heads/master, not refs/remotes/origin/master`","fromName":"Andry","fromEmail":"andry@inbox.ru","sentAt":"2023-02-25T21:48:08Z","receivedAt":"2023-02-25T21:46:20Z","isPatch":false,"sender":{"key":"andry@inbox.ru","avatar":null},"body":"Hello Git,\n\n\n\nThursday, February 23, 2023, 6:21:01 AM, you wrote:\n\nA> Found this issue and could find a solution.\n\nA> ...\n\nA> Is there a way to unmirror the remote repository back?\n\nSeems the problem was in the logic of the push algorithm.\n\nThere was 2 fors (pseudocode):\n\n```python\nfor remote in remotes:\n  for branch in branches:\n    git_push([remote, ':refs/remotes/' + remote + '/' + branch])\n```\n\nInstead of 3 fors:\n\n```python\nfor remote in remotes:\n  for ref_remote in remotes:\n    for branch in branches:\n      git_push([remote, ':refs/remotes/' + ref_remote + '/' + branch])\n```\n\nBecause each remote has `num(refs) = num(branches) x num(remotes)` after the mirror.\n\n"}]}