ILD

git worktree
2018-5-26
git wortree 管理多个工作树语法1234567git worktree add [-f] [--detach] [--checkout] [--lock] [-b ] []git worktree list [--porcela

git log出现ESC
2018-11-4
git log出现ESC[33m等乱码的东西这是由于git的分页less,将转义序列分开了。执行git config --global core.pager "less -r"解决问题:参考https://stackoverflow.com/questions/20414596/how-to-get

git checkout branch如何处理index和work tree
2018-11-5
checkout branch处理的原则是,只要不导致数据丢失,那么就不会阻止checkout成功,并且原来的修改会带到新的分支。Work Tree如果当前分支的工作树没有任何变化,且没有untracked files,那么新的工作树将完全等于新分支的工作树(意味着旧分支多的文件将被删除,不同的文件

git删除一个commit
2019-3-2
想要从git中永久的删除一个commit,可以使用$ git rebase -i HEAD~4-i是交互模式,在弹出的编辑中,d删除对应的commit即可。这是个vi编辑器,编辑后退出,git将执行rebase和gcSuccessfully rebased and updated refs/head

Git: Show commits that have touched specific text in a file
2019-4-15
If you want to find the commits that touched a specific text in a file, use git log -S 'text in the code' -- path/to/file.Here is an example, where th

如何查看某个commit包含某个blob
2019-5-29
有一份代码,git日志全丢失了,还有一份官方的git代码库,怎么知道这一份代码是什么时候的呢?在旧代码,选择一个文件,计算其blob hash$ git hash-object config-3.3506e8f294d08c663a07022152611fcdcc27f6f9f在git仓库,使用de

cherry-pick发生冲突时,HEAD,index和working tree的状态
2020-11-9
当有冲突而不能完成整个cherry pick时:HEAD保持不变,仍然指向当前分支的最后一次commit。CHERRY_PICK_HEAD,指向要cherry-pick的commit。没有冲突的路径,更新index和working tree。对于有冲突的路径:Index会保存3个版本,可以用git

git log --stat显示文件名不全的问题
2021-1-6
$ git log -1 --statcommit 31587371f37de24fc8dd79a6520f1023c2900da8 (HEAD -> iteration2)Author: XXX <71912@xxx.com>Date: Fri Dec 18 15:30:07 2020 +08

git am & apply 的trailing whitespac
2021-5-29
使用format-patch生成patch,在am打patch的时候,告警:git am /work/Xrouter/kernel/patches-4.14.120/0001-add-openwrt-patches.patch /home/yua

git查看那个分支包含某个commit
2021-12-5
使用git branch的--contains选项,可以列出包含某个commit的所有分支。比如要查看,openwrt官方仓库,包含v21.02.1这个发布tag是哪个分支创建的。$ git branch -a --contains v21.02.1remotes/origin/openwrt-21

Copyright © linuxdev.cc 2017-2024. Some Rights Reserved.