随笔分类 - Git
摘要:
阅读全文
摘要:场景: 从远端分支新建一个本地分支: git fetch git checkout -b localBranchName origin/branchA 然后,在本地的localBranchName分支进行改动,然后,git add, git commid,然后,执行git commit时,会报错,因
阅读全文
摘要:Windows使用回车和换行两个字符来结束一行,而Mac和Linux只使用换行一个字符。虽然这是小问题,但它会极大地扰乱跨平台协作。 待验证: Git可以在你提交时自动地把行结束符CRLF转换成LF,而在签出代码时把LF转换成CRLF。 用core.autocrlf来打开此项功能,如果是在Windo
阅读全文
摘要:git checkout -f branchName
阅读全文
摘要:https://git-scm.com/docs/git-gc NAME git-gc - Cleanup unnecessary files and optimize the local repository SYNOPSIS git gc [--aggressive] [--auto] [--q
阅读全文
摘要:git log --author=“author” 可以查找某一个作者所有的提交. Note:可以不加引号。
阅读全文
摘要:git blame file_name例如: git blame -L 58,100 file_name # 58~100 行代码 其输出格式为: commit_ID | 代码提交作者 | 提交时间 | 代码位于文件中的行数 | 实际代码 根据 commit_ID 可以查看对应的提交记录: git
阅读全文
摘要:2020-05-03 git clean命令用来从你的工作目录中删除所有没有tracked过的文件 git clean经常和git reset --hard一起结合使用,git reset只影响被track过的文件, 所以需要clean来删除没有track过的文件. 结合使用这两个命令能让你的工作目
阅读全文
摘要:git stash save git stash list git stash show git stash apply stash@{0} //0为序号, git stash pop stash@{0} git stash drop stash@{0} :丢弃stash@{$num}存储,从列表中
阅读全文
摘要:Git默认配置为忽略大小写,解决方法 git config core.ignorecase false
阅读全文
摘要:1. git log filename 查看提交记录 2. git log -p filename 可以显示每次提交的diff 3. 查看某次提交中的某个文件变化,可以直接加上fileName git show c5e69804bbd9725b5dece57f8cbece4a96b9f80b fil
阅读全文
摘要:Ref: https://www.jianshu.com/p/a412f8aeaec0
阅读全文
摘要:其他: 1) 查看最近n次提交的修改: git log -p -n 2) 获取commit id: git log
阅读全文
摘要:合并多次commit记录: good: https://blog.csdn.net/csdlwzy/article/details/83379546 使用 git log 命令查看提交历史: 想要合并前三个 commit ,使用下面的命令: 进入编辑界面,把要保留的 commit 使用pick,其他
阅读全文
摘要:自己做实验: 在gitee上建一个repo1: https://gitee.com/firstsnowflakes/testGit1 , 其会将另一个repo2: https://gitee.com/firstsnowflakes/testGit2 作为一个submodule来应用。 1) 将rep
阅读全文
摘要:刚刚提交了三个commit, git reflog显示如下: 最后一个commit在文件末尾加了一行:v3,以此类推: 下面,使用git reset --hard commitID来进行commit回退:(应该回滚的时工作区的commit版本吧) 1)回到最后一个commit之前,即回到v2后的版本
阅读全文
摘要:1、添加某个文件类型到暂存区,比如所有的 .html 文件。 git add *.html 2、添加某个文件或者某个文件夹中的某个文件到暂存区 ,比如 index 下的 index.html 文件。 注意:不加参数默认为将修改的文件 和 未跟踪新添加的文件 添加到git系统的暂存区,不包括删除。 (
阅读全文
摘要:git clean用法:https://www.cnblogs.com/lsgxeva/p/8540476.html :
阅读全文
摘要:$ git lfs migrate import --everything --include='*.LIB'https://github.com/git-lfs/git-lfs/issues/2839 https://github.com/git-lfs/git-lfs/issues/1939
阅读全文
摘要:是生成一个和commitid的提交完全相反的提交。类似倒转。
阅读全文

浙公网安备 33010602011771号