1
0

More than 3 years have passed since last update.

GitHub 設定手順 ( macOS Big Sur )

Last updated at Posted at 2021-02-09

目的

Electronで作ったアプリをGitHubを使ってアップロードする手順のメモ

環境

macOS Big Sur
git 2.24.3

1. Git初期設定

terminal
$ git config --global user.name "【ユーザー名】"
$ git config --global user.email 【メールアドレス】
git情報の確認
$ git config --list

2. 鍵の作成・設定

terminal
$ ssh-keygen -t rsa -b 4096 -C "【メールアドレス】"
$ Enter file in which to save the key (/Users/hoge/.ssh/id_rsa):/Users/YUI/.ssh/id_rsa_github
$ Enter passphrase (empty for no passphrase): 【パスフレーズを入力】
$ chmod 600 ~/.ssh/id_rsa_github
ssh-agentに秘密鍵を登録
$ ssh-add ~/.ssh/id_rsa
terminal
$ vim ~/.ssh/config
Host github
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa_github

3. リポジトリを作成する

GitHub
$ 省略

4. GitHubに公開鍵を登録する

「SSH and GPG keys」にアクセス

terminal
$ vim /Users/YUI/.ssh/id_rsa_github.pub

5. GitHubへのssh接続確認

terminal
$ ssh -T git@github.com

6. GitHubに新規でプッシュする

terminal
$ cd my-app
my-app
$ echo "# Test" >> README.md
$ git init
$ git add "作業フォルダ名"
コミットする
my-app
$ git commit -m "【コミット名】"
プッシュする
my-app
$ git branch -M main
$ git remote add origin git@github.com:yui0718/【リポジトリ名】.git //originを作成
$ git push -u origin main 

7. GitHubに追加でプッシュする

my-app
$ git add "作業フォルダ名"
$ git commit -m "【コミット名】"
$ git push -u origin main 

その他

originを一旦削除
$ git remote rm origin

参考サイト:
https://eh-career.com/engineerhub/entry/2017/01/31/110000
https://qiita.com/shizuma/items/2b2f873a0034839e47ce

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0