随笔分类 - git
摘要:git add -A :是上面两个功能的合集(git add --all的缩写) git add -A 提交所有变化 git add -u 提交被修改(modified)和被删除(deleted)文件,不包括新文件(new) git add . 提交新文件(new)和被修改(modified)文件,
阅读全文
摘要:git tag 是给 commit ID 标签,这样能让人知道代码在哪个节点,发布了版本,或截至到哪个ID,来做个记录 ### 1.查看本地所有 tag: ```bash git tag 或者 git tag -l ``` 多列显示 ```bash git tag --column ``` ###
阅读全文
摘要:log日志,默认显示是黑白的,看这个不方便。加点颜色显示看着更方便。 一、颜色示例 1.默认显示: git log -1 --pretty="format:%h %s" 2.加彩色显示: git log -1 --pretty="format:%h %Cgreen %s %Creset" %h %s
阅读全文
摘要:1.git在日志中查找这个文件. git log --pretty=oneline --branches -- 文件名 或 git log --pretty=oneline --branches -- 文件夹名 注意:--后和文件(夹)名前,必须要有空格 筛选参数 [注] 1)按数量 -n:显示前n
阅读全文
摘要:拉取远程仓库所有的分支到本地 ```bash for i in $(git branch -r); do $(git checkout $i && git pull --all); done ``` 参考: https://www.zhihu.com/question/54419234/answer
阅读全文
摘要:git 提交说明规范: 图片版:  文字版: 提交格式如下: 格式start > \\[scope\]: \
阅读全文
摘要:git blame用来追溯一个指定文件的历史修改记录 用法: `git blame filename` 可以使用 -L 指定文件的行数范围: `git blame -L n1,n2 filename`  git reset --hard HEAD^ - 参考: https://
阅读全文
摘要:- - 来源: https://blog.csdn.net/m0_47403102/article/details/122538395
阅读全文
摘要:单行: git commit -m "这是更新注释" 多行: 方式一: git commit -m "注释1" -m "注释2" -m "注释3" 注意:[注] 从 man git commit:-m <msg>, --message=<msg>使用给定的 <msg>作为提交消息。如果给出了多个 -
阅读全文
摘要:命令: 查看提交的 commit 信息,显示 ID 、作者、提交说明 git log 命令: 查看提交的 commit 信息,显示 ID 、作者、提交说明、提交的详细文件 git log -p --
阅读全文
摘要:一些常用简写命令: git st # git status git ci # git commit git br # git branch git co # git checkout git mg # git merge git line # git log --oneline 当然,你也可以直接在
阅读全文
摘要:ubuntu下使用git提交代码时,git commit时默认的编辑器是nano, 用惯了vim,所以如果修改默认编辑器,可以这样解决: 编辑 .git/config 在 core 这块,加入 editor = vim 另一种方法,全局都使用 vim 编辑器: git config --global
阅读全文
摘要:git commit -m ‘注释内容’ 假设,注释内容写错了,可以不用撤回提交,用 --amend 参数修改 git commit --amend 进入编辑模式,修改完保存即可 参考: https://blog.csdn.net/w_p_wyd/article/details/126028094
阅读全文
摘要:工作区、暂存区、仓库概念: https://www.cnblogs.com/pangdahaiaaa/p/16809755.html https://blog.csdn.net/weixin_39060517/article/details/125554797 一、放弃未追踪的文件(红色字体) gi
阅读全文
摘要:-先模拟提交过程,一共提交四次,每次都向文本里写一个新数 # 向文本中写入0 $ echo 0 >a.t $ git add . #第一次提交到仓库 $ git commit -m '0' # 向文本中写入1 $ echo 1 >a.t $ git add .; #第二次提交到仓库 $ git co
阅读全文