携わる案件:新規リポジトリ作成したあと、gitコマンドでfirst-commitをする方法
準備
空のフォルダ作成
ターミナルを開いて、作成した空のフォルダに移動
ディレクトリ見本
Documents/
└ www/
└ client01/ (クライアント名)
├ design (デザインデータを格納)
├ material (素材や情報を格納)
└ source (コーディングデータを格納)← 今回作成する空フォルダ
準備ができたら、以下のコマンドでOK!
clone
共有されたgitリポジトリをクローンする
command
git clone [リモートリポジトリのパス]
git status
command
git status
// no commits yet:まだコミットされてないと言われます。
git init
command
git init
// フォルダをgit管理下におく
touch [作成するファイル名]
command
touch README.md
//空の仕様書を作成する
git add [ステージングにあげるファイル名]
command
git add -A
// ファイルをステージングにあげる
git commit -m "first commit"
command
git commit -m "first commit"
// コメント付きでステージングエリアにあるものをリポジトリにコミット
git push -u origin master
command
git push -u origin master
// ステージングにあげてコミットしたファイルを、マスターにプッシュする
git status
状態を確認
command
git status
git log
コミット履歴を確認する
command
git log
おしまい
簡易バージョン
echo "# hoge" >> README.md
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/hoge
git push -u origin master
githubバージョン
GitHub
「+New Repository」ボタンをクリック
「Create repository」ボタンをクリック
ターミナル
git init
touch README.md
git add -A
git commit -m "first commit"
git remote add origin https://github.com/hogehoge.git
git push origin master
「git commit --amend --reset-author」が表示されたらCommiterを変更する
git config --local user.name abenosite
git config --local user.email abenosite@gmail.com