- https://github.com/ にアクセスしてアカウント作成
- ユーザー名、メールアドレス、パスワードを登録
brew install gitgit --version
which gitgit config --global user.name "Your Name"
git config --global user.email "your_email@example.com"git config --global core.editor "code --wait"--waitを付けることで、VS Code を閉じるまでGitが待機するようになる
touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global*.swp
*.swo
*.swx
*.un~
*.bak
*~
nvim-log.txt
.cache/ssh-keygen -t ed25519 -C "your_email@example.com"(保存先はデフォルトの /Users/yourname/.ssh/id_ed25519 でOK)
pbcopy < ~/.ssh/id_ed25519.pub- GitHub → Settings → SSH and GPG keys → New SSH Key に貼り付け
ssh -T git@github.comenv-checksetup-checkdev-env-test
Repository for verifying development environment setup.
git clone git@github.com:yourname/repo-name.git
cd repo-namegit switch -c testbranchgit add .
git commit -m "Initial commit"
git push -u origin testbranch→ ブランチが存在しない。作成して切り替えてから push。
git switch -c testbranch
git push -u origin testbranch→ リモートに先に変更がある。以下で対応:
git pull --rebase origin ブランチ名
git push- リポジトリページを開く
Codeタブの上部にある「コミットメッセージ」や「X commits」リンクをクリック- 個別ファイルの変更履歴は、ファイル表示ページで右上の
Historyをクリック