🖥
Git | Publish my .gitconfig alias
concept
Let's shorten the key type! Let's make development more fun!
Contents
[alias] branch-root = merge-base master HEAD ck = checkout st = status -s back = reset HEAD^ cm = commit cma = commit --amend amend = commit --amend create = !git add . && git commit cr = !git create final = !git add . && git commit --amend fn = !git final forget = !git final fg = !git final cmaf = !git final l = !git log --oneline --date=short --format=\"%C(yellow)%h%C(reset) %C(magenta)[%ad]%C(reset) %s %C(cyan)@%an%C(reset)\" $(git branch-root)..HEAD ll = log --oneline --name-status master.. br = branch df = diff ds = diff --staged remember = !git diff $(git branch-root) rr = !git remember names = diff --name-only HEAD^ history = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short rb = rebase rba = rebase --abort rbc = rebase --continue change-the-world = !git add . && git commit --amend && git rebase --continue ctw = !git change-the-world in-about-thirty-years = !git change-the-world back-to-the-future = !git rebase -i $(git merge-base master HEAD) bf = !git back-to-the-future rbi = !git back-to-the-future rebase-to = rebase one = log --oneline refresh = !git checkout master && git pull origin master && git checkout - && git rebase master new-world = !git refresh nw = !git refresh erase = clean -fd er = clean -fd vanish = !git reset . && git checkout . && git clean -fd stash = stash -u -k strike = push -f happy = blame wip = commit --allow-empty
Commentary
commit-force (cmf)
add .
all and commit as it is.
commit-ammend-force (cmaf)
All add .
commit --amend
.
refresh
Make master up-to-date. In addition, make the current branch follow master (rebase).
names
Display a list of files that have been changed or changed since the last commit.
erase
Delete all ungit-managed files in the working directory.
remember
Display the difference from the current branch root.
vanish
Erase all current working conditions. (reset => checkout => clean)
rebase relationship
- rbi: Start rebase in interactive mode from the current branch root.
- rbc: Advance rebase.
- rba: Exit from rebase.
- rebase-to: just an alias for git rebase. Since this command is difficult to understand intuitively whether it is rebase from or rebase to, I was able to specify it.
refresh
Rebase the work branch to the "latest master".
back
"Disassemble" the current HEAD and go back one step.
back = reset HEAD^
Usual guy
Aliases for familiar commands.
- co = checkout (If you write co, it looks like "coming out")
- ck = checkout (I'm using this not like "coming out")
- br = branch (newline-like)
- cm = commit (Commercial like but no problem)
- cma = commit-amend (bearish, often used)
- df = diff
environment
- git version 2.3.8 (Apple Git-58)
Original by
Git | 僕が使っている .gitconfig の エイリアスを公開
About
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。
公開日時
2019-04-16
Discussion