How do I make git request credentials (username + password) every time you click?
We have a shared host where the git log repository takes care of the version controlling a bunch of files. I want to pull the repository to a remote location via http and each time request a username + password (since this is a shared host, this ensures that we keep track of who is responsible for the latest changes).
I did:
git init
git remote add origin http:
However, when I click, I get HTTP 401 error and without username / password :
[user @thehost ~] # git push -u origin master error: requested URL returned error: 401 Unauthorized access while accessing http://remote.host/the_git_repo/info/refs
fatal: HTTP request failed
File contents .git/config:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
askpass = true
[remote "origin"]
url = http://remote.host/the_git_repo
fetch = +refs/heads/*:refs/remotes/origin/*
Notes:
- SSH login not available for this remote repo
- I read the documentation about environment variables
SSH_ASKPASSand GIT_ASKPASSbut it is not clear how to use them ( export GIT_ASKPASS=1does nothing) - This is similar to this question , the difference is that the repository has just been created and no one has added any credentials yet
source
share