...
Code Block | ||
---|---|---|
| ||
$ git token store https://github.com Username: <insert your Github username> Password: <insert your "Personal Access Token", not your GitHub password> |
Other
If you are using a desktop environment or distribution without support for GNOME Keyring, or if you want to use your own scheme for storing the PAT, then that is also supported. You can store non-sensitive data such as your username and the URL of the Git source code hosting provider in your ~/.gitconfig
file in the "credential" section:
...
For the PAT itself, all Skara tools interacting with an external Git source code hosting provider's API supports the GIT_TOKEN
environment variable. This means that instead of storing your PAT in a secure way in a Git credential manager you will have to secure the PAT according to your security requirements. To generate a a Personal Access Token on GitHub go to https://github.com/settings/tokens and and click on "Generate new token". You only need to select the "repo" scope (permission). The following sections give a few examples on how to secure securely store the PAT you just generated depending your security needs.
GPG
You can use GnuPG (GPG) to store your PAT in an encrypted file. The file can be encrypted either using a GPG key or using a passphrase. If you have a GPG key you probably already know how to encrypt a file with it, so we will only cover encrypting using a passphrase here. To encrypt the PAT in a file using a passphrase, run the following command (replacing <PAT>
with your personal access token):
...
Code Block | ||
---|---|---|
| ||
GIT_TOKEN=$(gpg --decrypt ~/pat.gpg) git pr list |
age
You can use age to store you PAT in an encrypted file. To encrypt the file using a passphrase, run the following command (replacing <PAT>
with your personal access token):
...
Code Block | ||
---|---|---|
| ||
$ GIT_TOKEN=$(age --decrypt ~/pat.age) git pr list |
File Permissions
Warning |
---|
This is not as secure as storing the personal access token encrypted. Any person or program who can read |
...
Code Block | ||
---|---|---|
| ||
$ GIT_TOKEN=$(cat ~/pat.txt) git pr list |
Creating a Personal Access Token
To create a a Personal Access Token on GitHub go to https://github.com/settings/tokens and and click on "Generate new token". You only need to select the "repo" scope (permission). After you have generated your token, store it in your credential manager using git token store
Code Block | ||
---|---|---|
| ||
$ git token store https://github.com
Username: <insert your Github username>
Password: <insert your "Personal Access Token", not your GitHub password> |
Creating a personal fork
The first step in the Skara workflow is to create a personal fork of an existing OpenJDK repository. Your personal fork is a copy of the original OpenJDK repository. Having a personal fork allows you to experiment with changes without affecting the original OpenJDK project. Having a personal fork also enables you to create pull requests targeted towards the original OpenJDK repository.
...