Git

Reference

  • Oh shit, git!
    • git 回滚远程仓库(revert、reset、rebase)
      • Git flight rules
        • Git 的奇技淫巧🙈

          Cheatsheet

          notion image

          Git Command

          git init

          git diff

          gitlab 中的 "Compare Revisions" 和 "Merge Requests Changes" 使用的是 "git diff origin/main...origin/branch" 方式, 见
          • Bug 单
            • Stack Overflow
              • Git Collaborating
                notion image
                notion image

                配置 VSCode 为 git difftool 和 git mergetool

                Clone a single folder from github

                Git submodule

                删除远程分支

                删除远程没有的本地分支

                Reset Commit

                Git log

                Reset commit

                Cherry-pick

                Migrate a repository

                Duplicating a repository

                https://help.github.com/articles/duplicating-a-repository/

                Git的4个阶段的撤销更改

                git revert

                Stash

                Merge

                Rebase

                git rebase 是一个危险命令,因为它改变了历史,我们应该谨慎使用
                git pull –rebase 的正确使用

                VS Code refresh git

                ^ vs ~

                GIT 配置

                代码换行符配置

                git 配置:git config –global core.autocrlf input vscode 配置:设置搜索行尾符,改为
                webstorm 配置:File | Settings | Editor | Code Style | Line separator,选择 Unix and macOS()
                如果发现项目中突然修改了很多文件且不是自己改的,多半是换行符的问题,进入项目根目录,确保.prettierrc 文件有 “endOfLine”: “lf”,没有则加上,然后运行 npm run fix:prettier 即可修复。

                打开 git 全局配置

                在项目中规范 git commit

                SVN

                Common SVN command


                © Jiyu Shao 2018 - 2025