LoginSignup
1
1

More than 5 years have passed since last update.

gitのメモ

Last updated at Posted at 2012-08-02

主にコマンドのメモ。
最近頑張って覚えようと思って、ATOK Padに入れてます。
(optionを2回押すとATOK Padが立ち上がるので・・・)

#indexに追加(-A:全部追加)
git add -A

#indexから削除
git checkout HEAD hogehoge.txt

#commit
git commit

#ブランチの作成
git branch hoge

#リモートブランチの作成
git branch hoge
git push origin hoge

#ブランチの確認(-a:全部表示、-r:remoteのみ表示)
git branch

#リモートブランチを無名ブランチとして取得
git checkout origin/hoge

#リモートブランチをローカルブランチとして取得
git checkout -b localhoge origin/hoge
(localhogeが新規作成される)

#リモートブランチの削除
git branch -d hoge
git push origin :hoge

#現在スイッチしてるbranchにhogeをrebase
git rebase hoge

#現在スイッチしているbranchにhogeをmerge
git merge hoge

#mergeの取り消し
git reset --hard HEAD^

#たった今行ったcommitの取り消し
git reset --soft

#コンフリクトしたfooブランチのbar.txtを、ブランチhogeのファイルで上書きする
git checkout hoge foo/bar.txt

ところどころ間違ってるかも。
あとで編集しよう。。。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1