A script for git initialization. Supports Windows, Linux, and macOS.
- Check if the git is installed.
- Check if the ssh package is installed.
- Configure the git user name and email.
- Generate the ssh key if it doesn't exist.
- Set the ssh client config to use the ssh key when connecting to github.com.
- Copy the ssh key to the clipboard in order to add it to the github account in webpage.
- Attempts to ssh to GitHub.
-
Download the script from https://github.com/hdaojin/git-init/releases/.
-
Run the script.
python3 git-init.py
-
Add the ssh public key content to the github account in webpage.
- The ssh public key content is in the clipboard.
- Login your github account in webpage.
- Click the user icon in the top right corner, and then click "Settings" -> "SSH and GPG keys" -> "New SSH key".
- Write the "Title" and paste the ssh public key content in the "Key" field.