Skip to content

Instantly share code, notes, and snippets.

@gadenbuie
Created August 20, 2024 12:36
Show Gist options
  • Save gadenbuie/86cae326c591990779e1fba9f934ad6f to your computer and use it in GitHub Desktop.
Save gadenbuie/86cae326c591990779e1fba9f934ad6f to your computer and use it in GitHub Desktop.
git, convert remotes from ssh to https
library(dplyr)
remotes <- gert::git_remote_list()
remotes |>
mutate(
url = sub("[email protected]:", "https://github.com/", url, fixed = TRUE),
url = sub(".git", "", url, fixed = TRUE)
) |>
purrr::pwalk(function(name, url) {
gert::git_remote_set_url(url, name)
})
gert::git_remote_list()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment