首页  

git的几个实用命令     所属分类 git 浏览量 502
git config --global --list 

git config --list 

git config --global credential.helper 'cache --timeout=3600'
内存缓存3600秒
git config --global credential.helper 'store'

~/.git-credentials  保存用户名密码 

git config --global user.name '杜刚'
git config --global user.email '53732908@qq.com'






git remote -v
origin	https://gitee.com/dyyx/fundtool.git (fetch)
origin	https://gitee.com/dyyx/fundtool.git (push)


git reset --hard  xxx
回滚版本 git log 只能看到  HEAD 之前的版本
git reflog   可以看到 所有的版本 
可以 reset  到指定的版本

git merge 只产生一个commit 
git merge --squash  otherbranch 
squash 压扁 挤进 塞入
把分支上的所有commit合并为一个commit后再merge到目标分支

git merge --squash 后再提交

git grep  keyword  
搜索含有关键词的文件 


git blame  filename  
查看指定文件每一行的提交人和提交时间 

git blame -L 100,10 文件名 
从100行开始,到110行 逐行查看文件的修改历史



git log -p filename
查看指定文件的变更和提交历史

查看最后一次提交的修改文件信息
git show --raw

查看指定 commitid 对应的修改文件列表

git show --raw commitid

git show --raw xxx

查看所有提交的修改文件信息

git log --stat
git log --name-only


查看指定author的修改信息
git log --author=dugang

上一篇     下一篇
MySQL jdbc 版本问题导致 连接错误

java Virtual Threads 虚拟线程

GO gc 要点

networking io with virtual threads

guice例子

java 虚拟线程使用