Life is Beautiful?

ITエンジニアが過去の先達への感謝を念頭に、自分で試行錯誤した結果や色々な技術情報を撒き散らしています。

よく使うgitコマンド集

 

 


### 基本コマンド

  • git init

空のリポジトリを作成する
* git clone <URL>
* git status
* git add <file_name>
* git commit -m

* git push -f
* git diff
* git tag -a beta
* git branch
* git branch -d
* git checkout -b <new_branch> <origin_branch>
* git merge

### コミットの取り消し
* git commit --amend
* git revert
* git reset
* git rebase -i <base(例 HEAD~3)>


### ログ
git show
git log
git log --oneline
git log --stat
git log -p
git log --oneline --decorate
git log --oneline --decorate --graph --all
git shortlog
git log --author="<author>"
git log --grep="<string>"


### リモートコマンド
git remote
git remote add
git remote -v
git remote add origin <https://github.com//.git>
git remote remove origin