Git Alias
和bash shell一样,git也拥有自定义alias的功能
如下这些alias是非常实用的。
co = checkout
st = status
br = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
cp = cherry-pick
hist = log --graph --pretty=format:'%Cred%h%Creset - %C(yellow)%d%Creset %s %Cgreen(%ci)%Creset %Cblue[%an]' --abbrev-commit --date=relative
ignore rule
对于已经在repo里的文件,如果要把它从repo里删除掉,要做两件事情。
- 把需要移除的文件放到`.gitignore`中
- 使用git rm --cached xxx.xxx, 把目标文件从repo中删除掉。
否则会出现不work的情况。