Skip to content

Git setup

Install and Setup Git

PS C:\Users\yuichi> git --version
git version 2.43.0.windows.1
If you don’t have git installed, download from site

PS C:\Users\yuichi> git config --global user.name
PS C:\Users\yuichi> git config --global user.email

PS C:\Users\yuichi> git config --global user.name "myname"
PS C:\Users\yuichi> git config --global user.email "my@email.com"

PS C:\Users\yuichi> git config --global user.name
myname
PS C:\Users\yuichi> git config --global user.email
my@email.com

Generate SSH key

PS C:\Users\yuichi> cd ~
PS C:\Users\yuichi> mkdir ~/.ssh

PS C:\Users\yuichi> ls
    Directory: C:\Users\yuichi
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        2024/01/19     14:06                .ssh

PS C:\Users\yuichi> cd .ssh
PS C:\Users\yuichi\.ssh> ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter file in which to save the key (C:\Users\yuichi/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\yuichi/.ssh/id_ed25519.
Your public key has been saved in C:\Users\yuichi/.ssh/id_ed25519.pub.
The key fingerprint is:
SHA256:4H1q1Vm3hiVULfX8F34lMPeKkypG5MNEFSc yuichi@YUICHITAMIY05CB
The key's randomart image is:
+--[ED25519 256]--+
|    o.oo. . =+=oo|
|   . =.. . + +.==|
|    + E . . * o *|
|     = B   * =  +|

PS C:\Users\yuichi\.ssh> ls
    Directory: C:\Users\yuichi\.ssh
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        2024/01/19     14:17            419 id_ed25519
-a----        2024/01/19     14:17            105 id_ed25519.pub

PS C:\Users\yuichi\.ssh> cat id_ed25519.pub | clip

Note

For mac
.ssh % pbcopy < id_ed25519.pub

Add Public key in gitlab

Alt text


Last update: January 23, 2024