LoginSignup
0
0

More than 3 years have passed since last update.

個人的によく忘れるgitコマンド

Last updated at Posted at 2019-10-21

直前のコミットを取り消す

git reset --soft HEAD^

ローカルブランチ名を変更してリモートに反映する

1 ローカルブランチ名変更

git branch -m <古いブランチ名> <新しいブランチ名>

2 リモートに反映

 git push origin <新しいブランチ名>

特定のブランチをクローンする

git clone  -b ブランチ名 https://github.com/ユーザー名/リポジトリ名.git

gitで特定のコミットから新しくブランチを切る

git checkout (コミットハッシュを特定できるもの) -b <ブランチ名>

コミットハッシュのままブランチを切ると名前が肥大化してしまう

リモートブランチ削除

 git push --delete origin ブランチ名

ローカルブランチ削除

git branch -D [ブランチ名]

何回も調べなおすの面倒なので、どんどん追記していきます。

0
0
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
0
0