Skip to content

t44cd/git_memo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

git_memo

config

git config {option}

checkout remote branch to local branch

git checkout -b {local_branch_name} {origin/remote_branch_name}

Line Break CRLF 16/8/19

git config core.autocrlf
true
git config --global core.autocrlf false
git config core.autocrlf
false

Commands

  • ls: git ls-files

  • commit back: git rest --hard hash

  • Cancdl(Reset) git add

    • git rest HEAD {file_name}
    • git reset --soft ワークディレクトリの内容はそのままでコミットだけを取り消す
    • git reset --hard コミット取り消した上でワークディレクトリの内容も書き換える
  • Push local branch to remote branch

    • git checkout {local_branch_name}
    • git origin {remote_branch_name}
  • Delete

    • git rm {file_name}
    • git rm -r {dir_name}
    • git rm --cached {file_name} ファイルを残してgitの管理対象外にする
  • Stash

    • git stash (save) ("foovarbuz")
    • git stash save -u with untrack files
    • git stash list
      • confirm changes: git stash -p
    • git stash show {stash_name}
    • git stash show -p {stash_name} show files diff
    • git stash show <適用したstash名> -p | git apply -R apply で復活して取り消しいたい場合、git stash show -p パッチ形式で出力、git apply -R でパッチを逆に適用
    • git stash apply stash@{0}
    • git stash drop stash@{0}
    • git stash pop apply update stash, delete old
    • git stash pos stash@{N} apply N stash, delele old
  • Checkout

    • git branch -a
    • git fetch
    • git checout -b {your_branch_name} {origin/remote_branch_name} -b: automatic branch checkout
  • Ammend

    • git commit --amend -m '' 「git commit --amend」を使用した場合、元のコミットを上書きするのではなく、元のコミットを無効にして、新たなコミットを作るという動作
  • Show log

    • git show HEAD
    • git show HEAD^^ 最新の2つ前にログを見る HEAD~2 も同じ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published