Skip to content

Instantly share code, notes, and snippets.

@awn-git
Last active November 11, 2016 18:49
Show Gist options
  • Save awn-git/5bb98443622dbbf35fe3ff18e0d13213 to your computer and use it in GitHub Desktop.
Save awn-git/5bb98443622dbbf35fe3ff18e0d13213 to your computer and use it in GitHub Desktop.
gitコマンド
//////////////////////////////////
//
//gitコマンド
//
//////////////////////////////////
/************************************************************
初回
*************************************************************/
//レポジトリを作る
#これはweb上でやってしまおう
//レポジトリからクローン(ダウンロード)する
git clone https://github.com/awn-git/my_repository.git
cd ./my_repository
//名前とメールを編集する
git config --list
git config user.name my_name_brabrabra
git config user.email [email protected]
git config --list
//ブランチの確認とdevelopブランチを作る
git branch
git branch develop
git branch
//developブランチに移動
git checkout develop
git branch
/************************************************************
ファイル編集後
*************************************************************/
//とりあえずstatus確認
git status
#modified: なんちゃらファイル 、と出る
//編集が終わっり区切りが来たらaddする
git add "ファイル名"
#これでステージングされる -> ステージングされていればcommit可能
//いくつかの編集が終わり区切りが来たらコミットする
git commit -m "コメント"
//そしてリモートレポジトリ(Github)にpushする
git push origin develop
/************************************************************
ファイル削除後
*************************************************************/
//とりあえずstatus確認
git status
#deleted: なんちゃらファイル 、と出る
//編集が終わっり区切りが来たらaddする
git rm "ファイル名"
#これでステージングされる -> ステージングされていればcommit可能
/************************************************************
developブランチをmasterブランチにmergeする
*************************************************************/
git branch
#マージ元(develop)にいるとマージできないのでmasterに移動
git checkout master
git branch
git merge develop
#これでマージ完了。と同時にcommitも実行されるらしい。
git status
#とりあえず確認
git push origin master
#最後にリモートレポジトリに反映する。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment