0

I am creating a Java application that allows a user to push some changes to a git repository without having to use the command line.

So far I have the ability to run a bash script that is setup to stage changes, commit, and push. The commit summary and description are filled in by arguments from when the script is executed in the program (the GUI receives the user's inputs, stores them in variables, and then uses those variables when executing the script).

Everything works well, but then comes up the necessity to log into a Github, Bitbucket, etc. account. Is there a way for me to securely receive the credentials from the Java GUI and then fill them in automatically to the running script?

1 Answer 1

2

If you want to use Git from within a Java program, there is a fully featured Git library called JGit. JGit is a relatively full-featured implementation of Git written natively in Java, and is widely used in the Java community. The JGit project is under the Eclipse umbrella, and its home can be found at http://www.eclipse.org/jgit.

Have alook into this implementation https://git-scm.com/book/en/v2/Embedding-Git-in-your-Applications-JGit

For your problem related to credentials have alook in to this link https://git-scm.com/docs/git-credential-store

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.