-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to prefer git
(ssh) protocol instead of https
for cloning repos
#312
Comments
alfeilex
added a commit
to alfeilex/IDEasy
that referenced
this issue
Oct 29, 2024
alfeilex
added a commit
to alfeilex/IDEasy
that referenced
this issue
Oct 29, 2024
devonfw#312-enhance-git-syntax-urls
alfeilex
added a commit
to alfeilex/IDEasy
that referenced
this issue
Oct 29, 2024
…into devonfw#312-enhance-git-syntax-urls
alfeilex
added a commit
to alfeilex/IDEasy
that referenced
this issue
Oct 30, 2024
alfeilex
added a commit
to alfeilex/IDEasy
that referenced
this issue
Oct 30, 2024
…com/alfeilex/IDEasy into devonfw#312-enhance-git-syntax-urls
alfeilex
added a commit
to alfeilex/IDEasy
that referenced
this issue
Nov 4, 2024
hohwille
added a commit
to alfeilex/IDEasy
that referenced
this issue
Nov 11, 2024
hohwille
pushed a commit
that referenced
this issue
Nov 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a IDEasy, I want to be able to configure my preference for
https
vs.ssh
for cloning my projects so that I can benefit from authentication advantages.Most git repositories can be cloned and synced both via
https
orgit
(ssh
) protocol and developers have the freedom of choice between those two. See e.g. on github:Some enterprises host their git repos behind some general SSO for all
https
URLs that requires 2FA, cookies, etc.Therefore, developers might have less trouble using
git
(ssh
) protocol but in order to use it, you first need to do some manual preparations:Therefore simple users can start easily with
https
that is default choice while advanced users often prefergit
(ssh
).This story is about creating a property
PREFERRED_GIT_PROTOCOL
that allows to automatically configure a preferred git protocol.The default is that this property is not defined and then the behave is like the current state where the git repository URL is used as is for cloning.
However, if this property is defined, then a git repository URL is converted to the preferred protocol:
PREFERRED_GIT_PROTOCOL=git
will automatically changehttps
git URLs togit
PREFERRED_GIT_PROTOCOL=https
will automatically changegit
git URLs tohttps
The transformation can be seen from our github url:
So the prefix is either
https://
orgit@
and after the hostname there is a slash (/
) for https but a colon (:
) for git.In case
PREFERRED_GIT_PROTOCOL
is defined and the git URL starts with its value, then nothing is to be done, otherwise the transformation.One excuse I would see as hardcoded build-in is that for the hostname
github.com
we should not change the protocol, because we only use this for public OSS repositories that do not need any authentication at all and most of our users will not have a github account with SSH setup. Sohttps://github.com/...
will just work out of the box but via git typical users will end up with this:The text was updated successfully, but these errors were encountered: