Created
August 20, 2024 12:36
-
-
Save gadenbuie/86cae326c591990779e1fba9f934ad6f to your computer and use it in GitHub Desktop.
git, convert remotes from ssh to https
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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