markdown 一堆Git的基本片段
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 一堆Git的基本片段相关的知识,希望对你有一定的参考价值。
[user]
name = user_name
email = user_email
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[core]
editor = nvim
autocrlf = input
safecrlf = true
[color]
# Use colors in Git commands that are capable of colored output when
# outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold # line info
old = red # deletions
new = green # additions
[color "status"]
added = yellow
changed = green
untracked = cyan
[merge]
keepBackup = false
tool = p4merge
[mergetool]
prompt = false
[mergetool "p4merge"]
cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
tool = p4merge
[difftool]
prompt = false
[difftool "p4merge"]
cmd = p4merge "$LOCAL" "$REMOTE"
keepTemporaries = false
trustExitCode = false
keepBackup = false
[push]
# change to maching for machines with older versions of git 1.x.x
default = simple
[pull]
rebase = true
[commit]
template = ~/.git-commit-template.txt
# Type(<scope>): <subject>
# <body>
# <footer>
# Type should be one of the following:
# * feat (new feature)
# * fix (bug fix)
# * docs (changes to documentation)
# * style (formatting, missing semi colons, etc; no code change)
# * refactor (refactoring production code)
# * test (adding missing tests, refactoring tests; no production code change)
# * chore (updating grunt tasks etc; no production code change)
# Scope is just the scope of the change. Something like (admin) or (teacher).
# Subject should use impertivite tone and say what you did.
# The body should go into detail about changes made.
# The footer should contain any JIRA (or other tool) issue references or actions.
# For a full example of how to write a good commit message, check out
# https://github.com/sparkbox/how_to/tree/master/style/git
# ---------------------------------------------------------------------------------
# Jira Issue Processing
# ISSUE_KEY #comment This is a comment
# ISSUE_KEY #done
# ---------------------------------------------------------------------------------
# Make sure you're adding under the [alias] block.
[alias]
st = status
s = status -s -b
a = add
ap = add -p
c = commit --verbose
ca = commit -a --verbose
cm = commit -m
cam = commit -a -m
m = commit --amend --verbose
d = diff
ds = diff --staged
dch = diff --name-status -r
dca = diff --cached
co = checkout
cob = checkout -b
fo = fetch origin
po = push origin
m = merge
mstop = merge --no-commit
mff = merge --no-ff
mffstop = merge --no-ff --no-commit
pi = cherry-pick -x
pigo = cherry-pick --continue
pistop = cherry-pick -x --no-commit
# push all
pushitgood = !echo 'Ah, push it' && git push -u origin --all && echo 'P-push it real good'
# Undo clashes with git-extras
rh = reset --hard
unstage = reset HEAD --
# delete merged branch
cleanmerged = !git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d
# When used without any argument it will print all changes since the last tag (changelog clashes with git-extras)
changes = "!f() { r=${1:-`git describe --tags --abbrev=0`..HEAD}; echo Changelog for $r; git log --reverse --no-merges --format='* %s' $r; }; f"
## Logs ##
##########
# one-line log
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
tree = log --oneline --decorate --graph
last = log -1 HEAD
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
# list branches sorted by last modified
b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
# Git Commit, Add all and Push — in one step.
cap = "!f() { git add .; git commit -m \"$@\"; git push; }; f"
# NEW.
new = "!f() { git cap \"
以上是关于markdown 一堆Git的基本片段的主要内容,如果未能解决你的问题,请参考以下文章
markdown [Git命令]一个基本的git命令#git #commands
markdown [Git基本操作]初始版本来自:https://github.com/levinit/itnotes/raw/master/git%E5%9F%BA%E6%9C%AC%E6%93%8