gitの使いかた
初期設定
git config --global user.name 名前
[h.watanabe@food program]$ git config --global user.email Eメール
ディレクトリを登録
mkidir test
cd test
git init
- ファイルを作成
test.txt
- 状態を確認
1689 git status
インデックスに登録
「.」 はすべて。ファイル名をいれると個別に登録できる.
1690 git add .
状態確認
1691 git status
コミット。インデックスされたものだけcomnitできる
1692 git commit -m "first commit"
ステージにないことを状態確認
1693 git status
■ここでウェブベースでbitbucket等にアクセスして、リポジトリを作成する. food
次に作ったアドレスに投入する.
push プッシュ先のアドレス ブランチ
例 food
1694 git remote add food https://bitbucket.org/USERNAME/food
1695 git remote add origin https://bitbucket.org/USERNAME/food
1696 git push -u origin master
1697 git push -u origin master
これでグローバルリポジトリに登録できる.
###originというグローバルリポジトリを登録
###git push originというグローバルリポジトリにマスターブランチに登録 -u アップデート分のみ。
グローバルリポジトリからもってくる git pull プッシュ先のアドレス ブランチ
git pull origin master