Skip to content

Instantly share code, notes, and snippets.

@pinzolo
Last active August 29, 2015 13:56
Show Gist options
  • Save pinzolo/8994594 to your computer and use it in GitHub Desktop.
Save pinzolo/8994594 to your computer and use it in GitHub Desktop.
git コマンドの tips というか一度調べたやつgit branch -m 変更後の名前
# 間違えて git rm したファイルを復活させる
git reset HEAD hoge/hoge.rb # キャッシュ上で復活
git checkout hoge/hoge.rb # ファイルの取り出し
# 現在のブランチ名の変更
git branch -m dest_branch_name
# 特定のブランチ名の変更
git branch -m src_branch_name dest_branch_name
# コミット間で変更のあったファイル一覧
git diff --stat <commit-from> <commit-to>
# 現在との比較なら
git diff --stat <commit>
# リモートブランチを削除(空をプッシュする)
git push origin :target-branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment