【Git】最初の30分で覚えるべき基本コマンド8選
最近若い子にGitの使い方を指導することがあったので、最初に覚えるべきコマンドを整理してみました。
clone
リモートリポジトリからローカルに複製する
git clone ssh://ユーザ名@サーバ名/path/to/repository git clone http://path/to/repository
status
ファイルの変更状況・ステージ状況を確認する
git status
add
ファイルをステージする(変更したファイルを次コミットの候補にする)
git add <ファイル or ディレクトリ>
commit
コミットする
git commit git commit -m <コミットメッセージ>
push
git push
pull
git pull
log
コミット履歴を確認する
git log
init
リポジトリを作成する
# ローカルリポジトリ git init # リモートリポジトリ git init --bare
ブランチの操作など応用的なコマンドに関する記事も書きました ↓