#author("2025-09-19T11:37:40+09:00","","") #author("2025-09-19T11:38:56+09:00","","") #norelated 総数:&counter(total); 今日:&counter(today); 昨日:&counter(yesterday); [[Memorandums]] * もくじ [#t1b7b844] #contents *Gitのインストール [#o7f3b45e] ~$ sudo apt install git ~$ git --version git version 2.43.0 *Gitの初期設定 [#b233bfad] Gitのユーザー名とメールアドレスを設定します(githubと連携するためのもの)。 ~$ git config --global user.name "あなたの名前" ~$ git config --global user.email "あなたのメールアドレス" githubに登録している名前とメールアドレスを使ってください。 *githubアカウントを作成(まだの場合) [#a19d1c96] githubの公式サイトでアカウントを作成します [[GitHubの公式サイト>https://github.com/]] *SSHキーを作成・githubと連携 [#sc1692dc] SSHキーで安全にgithubと通信できます。 **SSHキーの作成 [#qde416b8] ~$ ssh-keygen -t ed25519 -C "your_email@example.com" (途中で聞かれたら、基本的にEnterキーでOK) **SSHエージェントにキーを追加 [#a874eb48] ~$ eval "$(ssh-agent -s)" Agent pid 13417 ~$ ssh-add ~/.ssh/id_ed25519 Identity added: /home/<username>/.ssh/id_ed25519 (your_email@example.com) **公開鍵の内容をコピー [#mbb8ee7b] ~$ cat ~/.ssh/id_ed25519.pub **githubに登録 [#uae15887] githubの「Settings > SSH and GPG keys > New SSH key」で、コピーしたキーを貼り付け。 *githubにリポジトリを新規作成する [#qfae144f] ** https://github.com/new へいく [#f8bcd240] Create a new repository というページが表示される **General の Repository name を設定する [#b5ef02dd] test250919 **Configuration の Choose visibility を選択する [#hc7a1026] Private **Create repository ボタンを選択する [#heae1116] 新規リポジトリが作成されて、 https://github.com/<githubユーザー名>/test250919 というページが表示される *リポジトリをクローンする [#tc5a9ac5] ~$ git clone git@github.com:ユーザー名/リポジトリ名.git Cloning into 'test250919'... The authenticity of host 'github.com (20.27.177.113)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0) Receiving objects: 100% (3/3), done. remote: Counting objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0) Receiving objects: 100% (3/3), done.