You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
remote.push - how to know username/password is required and how to provide? #440
Which version of GitPython are you using ? There has been a bug that could cause it to omit certain messages to stderr in the past.
Besides, as a general note, GitPython will do auth only without any user input. Usually this works by supplying a working ssh configuration, or by configuring GIT_SSH_COMMAND via the custom environment functionality of repo.git.
I'm creating a GUI that I hope can make it easier to use GIT.
To that end I do not want to have to require the user to any complex setup and the SSH stufff is
more complex then useing https for example.
I think the solution has to be to set GIT_ASKPASS to run a process that the parent process
can receive the credentials requests from via a pipe/socket. Then I can pop up a dialog to ask for
credentials and pass them to git (I could also save in a Wallet for later use).
Is this something you would add and support in GitPython?
Ah, interesting ! I think you should be able to set custom environment variables per call or for all calls on each repository's git instance. That way you can provide your own program to bring up some GUI to collect the login data for you as needed.
Regarding this issue: I wouldn't know what to do about it ... can you clarify ?
I think that you should consider handling the credentials side of GIT in the GitPython code.
For this it looks like you need a executable that you point GIT_ASKPASS at.
Before running GIT in a subprocess you would setup GIT_ASKPASS and open a
pair of unix domain sockets/Windows Named Pips to send and receive the data
from the program in GIT_ASKPASS.
That program will read its stdin and write that into GitPythons pipe. GitPython calls a
auth_callback with the details (username or password
and URL). The callback returns the answer and GitPython writes it into the pipe for
hte GIT_ASPPASS program to output on stdout.
It seems this issue turned from a question and possibly a description of an issue (i.e. missing error description from git.push) into a specific feature request.
As to me GitPython is in maintenance mode and will only receive bugfixes or merges of suitable PRs, I flagged this issue as help wanted.
Maybe with you possibly implementing GIT_ASKPASS already, you might eventually see how the created code could integrate with GitPython to make it more useful to everyone.
During my work on gitoxide I learned that the protocol is critically important to know in this issue as well. For instance, only when using an http remote the git credentials machinery will be used if the server responds with 403. Otherwise, when ssh is used, I think all credential handling might be in the hands of the invoked ssh program.
Generally, to make authentication work across the board, configuration outside of GitPython would be required.
Activity
Byron commentedon May 25, 2016
Which version of GitPython are you using ? There has been a bug that could cause it to omit certain messages to stderr in the past.
Besides, as a general note, GitPython will do auth only without any user input. Usually this works by supplying a working ssh configuration, or by configuring GIT_SSH_COMMAND via the custom environment functionality of
repo.git.barry-scott commentedon May 25, 2016
I'm creating a GUI that I hope can make it easier to use GIT.
To that end I do not want to have to require the user to any complex setup and the SSH stufff is
more complex then useing https for example.
I think the solution has to be to set GIT_ASKPASS to run a process that the parent process
can receive the credentials requests from via a pipe/socket. Then I can pop up a dialog to ask for
credentials and pass them to git (I could also save in a Wallet for later use).
Is this something you would add and support in GitPython?
Byron commentedon May 26, 2016
Ah, interesting ! I think you should be able to set custom environment variables per call or for all calls on each repository's git instance. That way you can provide your own program to bring up some GUI to collect the login data for you as needed.
Regarding this issue: I wouldn't know what to do about it ... can you clarify ?
barry-scott commentedon May 26, 2016
I think that you should consider handling the credentials side of GIT in the GitPython code.
For this it looks like you need a executable that you point GIT_ASKPASS at.
Before running GIT in a subprocess you would setup GIT_ASKPASS and open a
pair of unix domain sockets/Windows Named Pips to send and receive the data
from the program in GIT_ASKPASS.
That program will read its stdin and write that into GitPythons pipe. GitPython calls a
auth_callback with the details (username or password
and URL). The callback returns the answer and GitPython writes it into the pipe for
hte GIT_ASPPASS program to output on stdout.
Is that the clarification you wanted?
Byron commentedon May 26, 2016
It seems this issue turned from a question and possibly a description of an issue (i.e. missing error description from git.push) into a specific feature request.
As to me GitPython is in maintenance mode and will only receive bugfixes or merges of suitable PRs, I flagged this issue as
help wanted.Maybe with you possibly implementing GIT_ASKPASS already, you might eventually see how the created code could integrate with GitPython to make it more useful to everyone.
barry-scott commentedon May 29, 2016
I'll experiment with solution in git-workbench and when I have something useful I will create a PR for you.
synergiator commentedon Oct 6, 2020
any updates here? For a private repo, it would be good to be able to pass over username and password.
Byron commentedon Oct 6, 2020
During my work on gitoxide I learned that the protocol is critically important to know in this issue as well. For instance, only when using an
httpremote the git credentials machinery will be used if the server responds with 403. Otherwise, whensshis used, I think all credential handling might be in the hands of the invokedsshprogram.Generally, to make authentication work across the board, configuration outside of GitPython would be required.
yafeiaa commentedon Jul 1, 2022
Here is the progress? Very need this solution.