4
3

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 Command Cheet Sheet

Last updated at Posted at 2015-06-22

レポジトリの初期化

git init

グローバルなユーザ名とメアド設定

git config —global user.name “~~~~”
git config —global user.email “@

特定のレポジトリ用のユーザ名とメアド設定

git config user.name “~~~~”
git config user.email “@

Git出力の色分け

git config —global color.ui “auto”

レポジトリのクローン

git clone

git remote add <リモートレポジトリ><レポジトリのURL>

ブランチの削除

git br -d

コミット前に

git diff HEAD
//直前との差分確認ができる

ブランチをマージするときにコメントを残す

git merge —no-ff (ブランチ名)

ブランチを視覚的に

git log —graph

現在のリポジトリで行われた作業ログ

git reflog

コミットメッセージの修正

git commit —amend

マージ前のコミット内容の修正(歴史の改ざん←)

git rebase -i HEAD~2
//続いて2行目の内容のpickをfixupと書き換える

addとcommitを同時に

git commit -am ‘コメント’

リモートのブランチdevelopをチェックアウト

git co -b develop origin/develop

間違えてaddした時の対処

git rm --cached -f -r [folder name]
or
git rm --cached -f [file name]

最新の状態に常に更新

git remote add upstream [originのサイト]
git fetch upstream

4
3
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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?