0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

git初心者だった(?)私がよく忘れるgitコマンドメモ

Posted at

いつもWebを見るので、いつも覚えられないのでメモ

  • 毎回検索してコピペするので、いつまでたっても覚えられない・・・
  • 毎回検索するのすら嫌になってきたので、使用頻度が高いと思うものを勝手にメモ
  • 体系的な解説ではないので、申し訳ございません。個人メモに毛が生えた程度です。

ローカルの編集をなかったことにする

git reset --hard HEAD &

configの中身確認

git config --list
◆名前の設定
git config --global user.name Nanashino.Gonbe
git config --global user.email nanashino.gonbe@noname.co.jp

リモートブランチをローカルにCheckoutする

git checkout -b local_branch_name origin/remote_branch_name

tagを指定してclone

git clone リポジトリ名 -b ブランチorタグ名

ブランチの作成

git branch -a
git checkout master
git checkout -b 作成するブランチ名
git branch -a
git push -u origin 作成したブランチ名

git cloneして違うリポジトリにpushする

git clone XXXXXX
git remote -v
git remote set-url origin ※新しく作成したリポジトリURL
git remote -v
git push origin master

ローカルブランチの削除

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?