1 see all detailed git info about single file
git log --pretty=oneline filename
2 把git diff显示的变成文件(文件名字pp)
git diff >pp
3查找git提交log中包含的key words
git log --grep='OTA' ./
4 修改分支名
git branch -m currentBranchName newname
5 提交到远程分支,新分支
git push origin local_brach_name
6 本地初始化空git仓库
git init 之后就可以git add 和commit了。
7在本地仓库添加一个远程仓库,并将本地的master分支push到远程
git remote add origin ssh://ip_address ~/xxx/.git
git push origin master
8 git apply: trailing whitespace.
Git预先设置了一些选项来探测和修正空白问题,其4种主要选项中的2个默认被打开,另2个被关闭,你可以自由地打开或关闭它们。
默认被打开的2个选项是trailing-space
和space-before-tab
,trailing-space
会查找每行结尾的空格,space-before-tab
会查找每行开头的制表符前的空格。
http://blog.csdn.net/shuyong1999/article/details/7185041
http://openwares.net/linux/git_diff_git_apply_patch.html
http://agile-boy.iteye.com/blog/274366
9 git remote rm origin 删除远程分支
git remote -v 查看远程有几个分支
10 git rm -r foldername 删除文件夹