LoginSignup
8
7

More than 5 years have passed since last update.

よくgitのコマンドを忘れる方のために [Memo]

Posted at

それは自分です。

git memo

直前のcommitを取り消したい

git reset --hard HEAD^

githubのpush先レポジトリを変更したい場合

git remote set-url origin https://github.com/xxx/yyy.git

過去のコミットにおけるCommiterとAuthorを全て変更

git filter-branch -f --env-filter "GIT_AUTHOR_NAME='xxx'; GIT_AUTHOR_EMAIL='zzz@example.com'; GIT_COMMITTER_NAME='xxx'; GIT_COMMITTER_EMAIL='zzz@example.com';" HEAD 
8
7
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
8
7