mendelssohnbach / github-workshop

GitHub勉強会で使用します

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

github-workshop

GitHub勉強会で使用します

内容

Step.1 リポジトリをフォークする

https://github.com/kanazawazawa/github-workshop
GitHub Fork クリック

Step.2 リポジトリをクローンする

GitHub Code クリック, SSH クリック, Copy
ターミナルでクローンする

git clone git@github.com:yourname/github-workshop.git
cd github-workshop/

URL確認

git remote -v

Step.3 ブランチを作成して切り替える

main, master, dev 等永続ブランチで直接作業しないようにする
ブランチを作成してチェックアウト

git checkout -b post-yourname

ターミナルのブランチ名が変更していることを確認する

git branch

Step.4 変更を加えコミットする

_posts の中に、YYYY-MM-DD-title.md ファイルを作成します。
例:2022-06-10-GitHub勉強会.md
ステイタスを確認し、ステージングエリアに登録、コミットする。

git status
git add -A
git commit -m "post yourname"
git status

Step.5 トピックブランチを リモートリポジトリにプッシュする

main ブランチとの diff を確認する

git diff main

ブランチをプッシュ!

git push origin <ご自身が設定したブランチ名>

Step.6 プルリクエストを作成する

GitHub Compare & request クリック
Leave a comment Create pull request クリック

(参考)プルリクエストがマージされた後にプルして最新の状態にする

git pull origin main

Step.7 実践

参考情報

Git Install

https://git-scm.com/

  • Checkout Windows-style, commit Unix-style line endings
    コミット時 CRLF→LF、ワークツリーに反映時 LF→CRLF

  • Checkout as-is, commit Unix-style line endings
    コミット時 CRLF→LF

  • Checkout as-is, commit as-is
    改行コードを変換しない

  • SSH

ssh-keygen -t ed25519 -C "youraccount@example.com"

Enter file in which to save the key
Enter

Enter passphrase

key をコピーする

clip < /c/Users/yourname/.ssh/id_ed25519.pub

GitHub Settings, SSH and GPG Keys, New SSH key

  • user.name, user.email
git config --global user.name yourname
git config --global user.email youraccount@example.com
git confit --list

Visual Studio Code Install

https://code.visualstudio.com/

Introduction GitHub

https://github.com/skills/introduction-to-github/

GitHub Pages

https://github.com/skills/github-pages/

firstcontributions

https://github.com/firstcontributions/first-contributions/

練習場

https://kanazawazawa.github.io/github-workshop/

About

GitHub勉強会で使用します