Open lizhe-0423 opened 1 month ago
The password needs to be a PAT (Personal Access Token), see https://github.com/eclipse-egit/egit/wiki/User-Guide#github-tutorial .
@tomaswolf sorry Probably because I'm a beginner ,I still can't read English documents efficiently You mean to say: public static CredentialsProvider createCredentialsProvider(String username, String password) { return new UsernamePasswordCredentialsProvider(username, password); } this password is PAT??? I tried to do this just now, but I still failed ;Or are there other API methods?
git.push().setCredentialsProvider(credential).call(); credential = new UsernamePasswordCredentialsProvider(username, password);
You need to first set the credentials provider on the PushCommand and then call its call()
method.
AFAICS in your code credential
is null when you call call()
.
Version
5.13.1.202206130422-r
Operating System
Windows
Bug description
use git.push().setCredentialsProvider(credential).call(); credential = new UsernamePasswordCredentialsProvider(username, password);
When submitting Times error
Actual behavior
not authorized
Expected behavior
commit succeed
Relevant log output
Other information
No response