随笔分类 -  git

摘要:git log 后面可以跟文件名,表示查看对应文件的修改记录 git log --pretty=oneline --format="%h:%ad:%an:%s" -5 git log --pretty=oneline --format="%H:%ad:%an:%s" -5 git log --abb 阅读全文
posted @ 2022-10-20 20:01 i舒 阅读(665) 评论(0) 推荐(0) 编辑
摘要:在为父级项目拉取更新时,还会出现一种特殊的情况:在你拉取的提交中, 可能 .gitmodules 文件中记录的子模块的 URL 发生了改变。 比如,若子模块项目改变了它的托管平台,就会发生这种情况。 此时,若父级项目引用的子模块提交不在仓库中本地配置的子模块远端上,那么执行 git pull --r 阅读全文
posted @ 2022-08-18 14:19 i舒 阅读(1445) 评论(0) 推荐(0) 编辑
摘要:https://www.jianshu.com/p/e27a978ddb88 https://www.cnblogs.com/lsgxeva/p/8540758.html 阅读全文
posted @ 2021-06-11 08:18 i舒 阅读(23) 评论(0) 推荐(0) 编辑
摘要:/ 显示每次修改的文件列表及状态 git log --name-status // 显示每次修改的文件列表 git log --name-only // 显示每次修改的文件列表, 及文件修改的统计 git log --stat // 显示每次修改的文件列表 git whatchanged // 显示 阅读全文
posted @ 2021-01-22 17:34 i舒 阅读(1443) 评论(0) 推荐(1) 编辑
摘要:how to use rebase? 1) melt commits into one git rebase –i HEAD~2 git rebase -i 25b19f9d0 b78e055aa commit前开后闭 2) Copy commits to another branch Execut 阅读全文
posted @ 2020-12-08 16:57 i舒 阅读(141) 评论(0) 推荐(0) 编辑
摘要:1.合并多个commit为一个完整commit git rebase -i [startpoint] [endpoint] 其中-i的意思是--interactive,即弹出交互式的界面让用户编辑完成合并操作,[startpoint] [endpoint]则指定了一个编辑区间,如果不指定[endpo 阅读全文
posted @ 2020-07-30 07:01 i舒 阅读(579) 评论(0) 推荐(0) 编辑
摘要:git stash save 'product' #这时其他操作如 git pull git stash apply #不删除对应的stash 也可以: git stash #其他操作,然后操作完成后 git stash pop #删除对应stash 参考:https://blog.csdn.net 阅读全文
posted @ 2020-07-08 09:37 i舒 阅读(1014) 评论(0) 推荐(0) 编辑
摘要:git diff --stat --name-only HEAD^ HEAD 阅读全文
posted @ 2020-07-07 10:07 i舒 阅读(11941) 评论(0) 推荐(0) 编辑
摘要:1、关于忽略文件的配置。 git rm -r --cached . git add . git commit -m 'update .gitignore' 2、关于忽略文件的路径。 git config --global core.excludesfile ~/.gitignore, 路径中有斜杠注 阅读全文
posted @ 2020-07-01 16:21 i舒 阅读(3690) 评论(0) 推荐(0) 编辑
摘要:查看两次提交中git submodule更改 git diff --submodule --name-only HEAD~1 HEAD |awk -F "/" '/3rdparty/ {print $1 "/" $2} '|uniq #HEAD指本次提交HEAD~1指上次提交3rdparty/dlp 阅读全文
posted @ 2019-08-24 09:16 i舒 阅读(1758) 评论(0) 推荐(0) 编辑
摘要:以repo1合并到repo2为例,总体来说有4步: 在repo2 clone到本地的代码目录中: 1. git remote add repo1 <repo1地址> 2. git fetch repo1 3. git branch repo1 repo1/master (仍在master branc 阅读全文
posted @ 2019-08-03 09:30 i舒 阅读(598) 评论(0) 推荐(0) 编辑