{"thread":{"id":"48241","subject":"getting pull and push URLs for the current branch","startedAt":"2018-04-08T10:15:56Z","lastAt":"2018-04-08T11:46:44Z","messageCount":2,"participants":["Michal Novotny","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"344094","messageId":"CANT8FXS_vsXb5oyma+d7fgEaYBqFYjM2N=S6O6hksObHhN8gWw@mail.gmail.com","threadId":"48241","inReplyTo":null,"subject":"getting pull and push URLs for the current branch","fromName":"Michal Novotny","fromEmail":"clime@redhat.com","sentAt":"2018-04-08T10:15:50Z","receivedAt":"2018-04-08T10:15:56Z","isPatch":false,"sender":{"key":"clime@redhat.com","avatar":null},"body":"Hello,\n\nis there a way to get remote url  for the current branch? That is the\nurl that will be used when I call `git pull`. It doesn't seem to be a\nparticularly easy task.\n\nThank you!\nclime\n"},{"id":"344096","messageId":"87o9itzzs3.fsf@evledraar.gmail.com","threadId":"48241","inReplyTo":"CANT8FXS_vsXb5oyma+d7fgEaYBqFYjM2N=S6O6hksObHhN8gWw@mail.gmail.com","subject":"Re: getting pull and push URLs for the current branch","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-04-08T11:46:36Z","receivedAt":"2018-04-08T11:46:44Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Sun, Apr 08 2018, Michal Novotny wrote:\n\n> is there a way to get remote url  for the current branch? That is the\n> url that will be used when I call `git pull`. It doesn't seem to be a\n> particularly easy task.\n\nYou'd do something like this (sans error checking):\n\n    git remote get-url $(git config branch.$(git rev-parse --abbrev-ref HEAD).remote)\n\nI.e. your HEAD may have remote tracking info set up, this'll get the\nremote URL for the remote it points at.\n"}]}