# Gitコマンドメモ ## clone ``` git clone リンク ``` githubのリモートリポジトリをローカルにダウンロードする 今回の開発に使うリンクは↓ ``` git clone https://github.com/FatherScorpion/BORIS.git ``` ## config ``` git config --global user.name ユーザーネーム git config --global user.email 登録したメアド ``` gitを使うユーザーを設定する。これをしないとできない事もある ## pull ``` git pull origin main ``` ↑はmainブランチをpullしている リモートの内容をローカルに持ってくる 定期的にmainはpullした方が良い! ## push ``` git push origin main ``` ↑はmainブランチにpushしている ローカルの内容をリモートに反映させる **mainにはpushしないように!!!** 自分が作ったブランチにpushしよう ## checkout ``` git checkout ブランチ名 ``` ブランチ名のブランチに移動する ちなみに ``` git checkout -b ブランチ名 ``` で新しいブランチを作りつつ移動できる(ブランチ名は指定したブランチ名になる) タスクごとに新しくブランチを作ろう ## add ``` git add --all ``` gitにファイルの変更内容を読み込ませる ## commit ``` git commit -m メッセージ ``` addして読み込ませた内容をコミット(gitに保存)する。メッセージには変更内容を書く ## 開発の流れ cloneする(初回のみ) ↓ mainからブランチを作る ↓ 作業をする ↓ addしてcommitしてpushする ↓ プルリクエスト送る ※定期的にmainをpullしよう! ※タスクが完了していなくても、キリが良いところでpushまでしておくとバックアップになって良い
×
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