Skip to content

Instantly share code, notes, and snippets.

@tomoko523
Last active November 4, 2016 08:57
Show Gist options
  • Save tomoko523/e4fea66c55535d029a05 to your computer and use it in GitHub Desktop.
Save tomoko523/e4fea66c55535d029a05 to your computer and use it in GitHub Desktop.
git使い始めて1ヶ月くらいでこれだけ覚えてたらなんとかなった ref: http://qiita.com/tomoko523/items/a2eb1cd7101011186a99
$ git config --global user.name "hoge hoge" //name
$ git config --global user.email hogehoge@hoge.com //Email
$ git config --global core.quotepath false //日本語表示
$ git config --global core.autocrlf false //改行コード
$ git config --(global/sysytem/local) --l
$ git add -A //削除されたソース〇、新規のソース〇
$ git checkout [ファイルパス/.]
$ git reset HEAD [ファイルパス/.]
$ git reset --soft HEAD^
$ git add [ファイルパス/.] //修正
$ git commit -a -c ORIG_HEAD
$ git reset --hard HEAD^
$ git add [ファイルパス/.] //修正
$ git commit -a -c ORIG_HEAD
$ git commit // まちがえたcommit
$ git add [ファイルパス/.] //修正
$ git commit --amend //commitを修正
$ git stash save "コメント"
$ git stash list //一覧表示
$ git stash pop
$ git status
Changes to be committed:
 ⇒merge成功したソース一覧
 自動的にaddされる
Unmerged paths:
 ⇒merge失敗したソース一覧
 該当ソースをひらいて手動で修正&addすること
$ git commit
$ git push
$ cd <gitリポジトリをつくるところ>
$ git clone http://…/hogehoge.git //初回のみ
$ git stash drop
$ git add -u
$ cd hogehoge
$ git branch <ブランチ名>
$ git branch //一覧&今いるブランチ表示
//ブランチを指定して変更
$ git branch -m <旧ブランチ名> <新ブランチ名>
//今いるブランチを変更
$ git branch -m <新ブランチ名>
$ git branch -d <ブランチ名>
$ git add
$ git commit -m "コメント"
$ git push
$ git add -u //削除されたソース〇、新規のソース×
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment