{"thread":{"id":"66630","subject":"Feature request: update password in remote URL","startedAt":"2026-10-22T09:52:27Z","lastAt":"2026-10-22T21:19:42Z","messageCount":2,"participants":["Ján Waclawek","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"555840","messageId":"CA+jzbCGmDYCS5XZmEnYpZ31a-cV5bncR04xv2BXz3eCyhBuCiQ@mail.gmail.com","threadId":"66630","inReplyTo":null,"subject":"Feature request: update password in remote URL","fromName":"Ján Waclawek","fromEmail":"jan.waclawek@taphome.com","sentAt":"2026-10-22T09:52:27Z","receivedAt":"2026-10-22T09:52:27Z","isPatch":false,"sender":{"key":"jan.waclawek@taphome.com","avatar":null},"body":"It would be useful to have a Git command that replaces only the\npassword embedded in a remote URL, preserving the username, hostname,\npath, and other URL components.\n\nFor example:\n\ngit remote set-password origin NEW_PASSWORD\n\nSecurity policies on various git servers stipulate to change password\nrelatively often. Currently, if a password expires or changes, users\nmust reconstruct the remote URL with the new password or use a script\nto modify it. A dedicated command would make this operation simpler\nand less error-prone.\n\nThe command should replace only the password component and preserve\nall other parts of the URL unchanged.\n\nI am aware of existence of credential managers, but sometimes they are\njust too much. I also understand that storing passwords in remote URLs\nhas security drawbacks, but this feature would help users who already\nuse the embedded credentials, work with servers that require URL-based\ncredentials and understand those drawbacks.\n\nJan Waclawek\n\n"},{"id":"555917","messageId":"atp97X1NaNIWCG9z@fruit.crustytoothpaste.net","threadId":"66630","inReplyTo":"CA+jzbCGmDYCS5XZmEnYpZ31a-cV5bncR04xv2BXz3eCyhBuCiQ@mail.gmail.com","subject":"Re: Feature request: update password in remote URL","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2026-10-22T21:19:42Z","receivedAt":"2026-10-22T21:19:42Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2026-10-22 at 09:52:27, Ján Waclawek wrote:\n> It would be useful to have a Git command that replaces only the\n> password embedded in a remote URL, preserving the username, hostname,\n> path, and other URL components.\n> \n> For example:\n> \n> git remote set-password origin NEW_PASSWORD\n> \n> Security policies on various git servers stipulate to change password\n> relatively often. Currently, if a password expires or changes, users\n> must reconstruct the remote URL with the new password or use a script\n> to modify it. A dedicated command would make this operation simpler\n> and less error-prone.\n> \n> The command should replace only the password component and preserve\n> all other parts of the URL unchanged.\n> \n> I am aware of existence of credential managers, but sometimes they are\n> just too much. I also understand that storing passwords in remote URLs\n> has security drawbacks, but this feature would help users who already\n> use the embedded credentials, work with servers that require URL-based\n> credentials and understand those drawbacks.\n\nI don't think we're going to implement or accept such a feature.  In\nfact, we've discussed disallowing URL-based credentials altogether a\ncouple times on the list.  The only reason we haven't done so is that\nwe agree it's convenient for test environments where the credentials\nhave no value.\n\nWe also know that since the URL is stored in the config file, it's\nactually very frequent that people expose the config file (such as on\nweb servers in some cases) and then they've exposed their credentials;\nthis is especially bad if the credentials are read-write, since then the\nrepository can be written to.\n\nCredential helpers can actually be very simple to use and the Git FAQ\nprovides an example[0] of how to use one to read credentials from an\nenvironment variable.  There's also `git-credential-store`, which is\nshipped with Git and which also uses a plaintext file, but not one under\nthe repository by default.\n\nYou can also use SSH with a public key if your server supports it and\nyou can use something like a deploy key to let systems automatically\nfetch and push if necessary.\n\nSo for those reasons (and probably some others I've forgotten), we're\nnot really interested in making support for using credentials in the URL\neasier given there are much better alternatives.\n\n[0] https://git-scm.com/docs/gitfaq#http-credentials-environment\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"}]}