Git development
 help / color / mirror / Atom feed
* Feature request: update password in remote URL
@ 2026-10-22  9:52 Ján Waclawek
  2026-10-22 21:19 ` brian m. carlson
  0 siblings, 1 reply; 2+ messages in thread
From: Ján Waclawek @ 2026-10-22  9:52 UTC (permalink / raw)
  To: git

It would be useful to have a Git command that replaces only the
password embedded in a remote URL, preserving the username, hostname,
path, and other URL components.

For example:

git remote set-password origin NEW_PASSWORD

Security policies on various git servers stipulate to change password
relatively often. Currently, if a password expires or changes, users
must reconstruct the remote URL with the new password or use a script
to modify it. A dedicated command would make this operation simpler
and less error-prone.

The command should replace only the password component and preserve
all other parts of the URL unchanged.

I am aware of existence of credential managers, but sometimes they are
just too much. I also understand that storing passwords in remote URLs
has security drawbacks, but this feature would help users who already
use the embedded credentials, work with servers that require URL-based
credentials and understand those drawbacks.

Jan Waclawek

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Feature request: update password in remote URL
  2026-10-22  9:52 Feature request: update password in remote URL Ján Waclawek
@ 2026-10-22 21:19 ` brian m. carlson
  0 siblings, 0 replies; 2+ messages in thread
From: brian m. carlson @ 2026-10-22 21:19 UTC (permalink / raw)
  To: Ján Waclawek; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 2502 bytes --]

On 2026-10-22 at 09:52:27, Ján Waclawek wrote:
> It would be useful to have a Git command that replaces only the
> password embedded in a remote URL, preserving the username, hostname,
> path, and other URL components.
> 
> For example:
> 
> git remote set-password origin NEW_PASSWORD
> 
> Security policies on various git servers stipulate to change password
> relatively often. Currently, if a password expires or changes, users
> must reconstruct the remote URL with the new password or use a script
> to modify it. A dedicated command would make this operation simpler
> and less error-prone.
> 
> The command should replace only the password component and preserve
> all other parts of the URL unchanged.
> 
> I am aware of existence of credential managers, but sometimes they are
> just too much. I also understand that storing passwords in remote URLs
> has security drawbacks, but this feature would help users who already
> use the embedded credentials, work with servers that require URL-based
> credentials and understand those drawbacks.

I don't think we're going to implement or accept such a feature.  In
fact, we've discussed disallowing URL-based credentials altogether a
couple times on the list.  The only reason we haven't done so is that
we agree it's convenient for test environments where the credentials
have no value.

We also know that since the URL is stored in the config file, it's
actually very frequent that people expose the config file (such as on
web servers in some cases) and then they've exposed their credentials;
this is especially bad if the credentials are read-write, since then the
repository can be written to.

Credential helpers can actually be very simple to use and the Git FAQ
provides an example[0] of how to use one to read credentials from an
environment variable.  There's also `git-credential-store`, which is
shipped with Git and which also uses a plaintext file, but not one under
the repository by default.

You can also use SSH with a public key if your server supports it and
you can use something like a deploy key to let systems automatically
fetch and push if necessary.

So for those reasons (and probably some others I've forgotten), we're
not really interested in making support for using credentials in the URL
easier given there are much better alternatives.

[0] https://git-scm.com/docs/gitfaq#http-credentials-environment
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-22 21:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-22  9:52 Feature request: update password in remote URL Ján Waclawek
2026-10-22 21:19 ` brian m. carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox