Skip to content

TreeZhiyuan/giter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

giter - my git command best practise

解决中文文件名被编码成\XXX数字的情况:

git config --global core.quotepath false
git config --global i18n.commitencoding utf-8

推送本地提交到特定远程分支

git push origin HEAD:remote_branch_name
git push origin your_local_branch_name:remote_branch_name

获取所有远程仓库的最新信息

git fetch

获取信息并清理已删除的远程分支

git fetch --prune
或简写
git fetch -p

设置每次 fetch 自动清理已删除的远程分支引用

git config --global fetch.prune true

我的git快捷键设置

[alias]
	app = apply
	apc = apply --check
	br = branch
	brr = branch -r
	brv = branch -vv
	brd = branch -D
	brm = branch -m
	bra = branch -a
    bsut = "!f() { git branch $1 --set-upstream-to origin/$2; }; f"
	sut = "!f() { git branch --set-upstream-to origin/$1; }; f"
	bu = branch -u 
	s = status
	cm = commit
	cma = commit --amend
	cmm = commit -m
	ckb = checkout -b
	ck = checkout
    ckp = checkout -
	df = diff
	dfg = diff --staged
	rt = restore
	rtg = restore --staged
	pl = pull
	plo = pull origin dev
	puo = pull origin dev:dev
	plr = pull remote
	ph = push
	phf = push -f
	phh = "!f() { git push origin HEAD:$1; }; f"
	st = stash
	stl = stash list
	std = stash drop
[commit]
	template = D:/ProgramFiles/Git/.githooks/commit-template.txt

About

Git starter testing project and my git command best practise

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published