# GitHub 手順書 ###### tags: `Git` 1. GitHub のコードをローカルに Clone ``` git clone -GitHub URL- ``` 1. node_modulesをクリーンインストール(プロジェクトに依存するパッケージをインストール) if (package-lock.jsonが存在する) { ``` npm ci ``` } else if (package-lock.jsonが存在しない) { ``` npm install ``` } 3. ローカルでブランチを切る ``` git branch your-branch-name ``` 1. 切ったブランチに変更 ``` git checkout your-branch-name ``` 1. ローカルで切ったブランチをリモートに Push ``` git push origin your-branch-name ``` 1. コードを書く 1. 変更があったファイル全てをステージに Add 、または手動で Add ``` git add -A ``` 1. 変更内容を添えて Commit ``` git commit -m 'message' ``` 1. コミットしたファイルをリモートに Push ``` git push origin HEAD ``` 1. GitHub で変更内容の詳細を添えてプルリクを送信 1. レビューしてもらって LGTM を貰ったら Merge 1. 自分が使用したリモートブランチを削除(自動設定有り) 1. ブランチを変更 ``` git checkout main ``` 1. 最新のリモートリポジトリの変更を取込 ``` git pull origin main ``` 1. 前回使用したローカルブランチを削除 ``` git branch -d your-branch-name ``` 1. 自分のブランチが削除できたか確認(origin/branch-name はリモートブランチ) ``` git branch -a ``` 1. もしリモートのブランチが残っていたら ``` git fetch -p ``` ## 雑談 (0→やまぴ 1→みや 2→やすい 3→りょうくん)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up