[[FrontPage]]

** 元に戻す系 [#e811f425]

- git checkout path/to/file
-- (git addする前の)ローカルで変更したファイルを元に戻す。
-- svn revert path/to/file相当。
- git rm --cached path/to/file
-- git addで追加したファイルを、git addする前の状態に戻す。
- git rm -r --cached path/to/dir
-- git addで追加したディレクトリを、git addする前の状態に戻す。
- git reset HEAD path/to/file
-- 変更してgit addしたファイルを、git addする前の状態に戻す。
- git checkout f2791447
-- 一時的に特定のリビジョンの状態に戻す。
-- svn up -r 1234 相当。
- git checkout f2791447 -- path/to/file
-- 特定のファイルだけを一時的に特定のリビジョンの状態に戻す。
- git revert f2791447
-- 特定のリビジョンに戻すような変更を作ってコミットする。
- git reset --hard f2791447
-- HEADを特定のリビジョンに戻す(それ以後の変更を履歴上も無かったことにする)。

** Github [#c7a5da8d]

- Githubでforkした人の変更をマージ
-- git pull git://github.com/'''username'''/'''project'''.git master
-- git push origin master
- [[リモートブランチを削除:http://github.com/guides/remove-a-remote-branch]]
-- git push origin :heads/'''branch'''

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS