🔧 基础操作
git init
git clone <repo_url>
git status
git add .
git commit -m "提交说明"
git log --oneline
git diff
🌿 分支管理
git branch <branch_name>
git checkout <branch_name>
git checkout -b <new_branch>
git merge <branch_name>
git branch -d <branch_name>
git branch -D <branch_name>
git branch -a
🚀 远程仓库操作
git remote add <remote_name> <repo_url>
git push -u <remote_name> <branch_name>
git push -f
git pull <remote_name> <branch_name>
git fetch
git push <remote_name> --delete <branch_name>
⏪ 撤销操作
git checkout -- <file>
git reset HEAD <file>
git commit --amend
git reset --soft <commit_id>
git reset --hard <commit_id>
git checkout <commit_id> -- <file_path>
🔍 日志与查询
git log --graph --all
git log --author="name"
git log -S "keyword"
git blame <file>
🔗 标签管理
git tag <tag_name>
git tag -a v1.0 -m "版本说明"
git push --tags
git tag -d <tag_name>
git push origin :refs/tags/<tag_name>
🧩 高级操作
git stash
git stash pop
git rebase -i HEAD~3
git bisect start
git bisect bad
git bisect good <id>
git clean -fd
⚙️ 配置相关
git config --global user.name "Your Name"
git config --global user.email "email@example.com"
git config --list
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
📦 子模块管理
git submodule add <repo_url> <path>
git submodule init
git submodule update
📌 实用技巧
git config core.fileMode false
curl https://gitignore.io/api/<语言/工具>
git count-objects -vH
git clone --branch <branch_name> --depth 1 <repo_url>
注意事项:
- --force操作前务必确认影响范围
- 重要分支(如main/master)避免直接修改
- 推荐使用SSH协议进行远程操作
- 定期执行 git gc 优化仓库
dblens数据库客户端[推荐]
sourceforge.net/projects/db…
dblens数据库管理工具(dblens for mysql)
- 🔧 可视化索引使用分析
- 📊 AI 索引设计分析
- 💡 智能索引优化建议
- 📊 AI 快速设计表、视图、函数、事件、存储过程
dblens数据库管理工具
- 🖥 可视化设计:拖拽式表结构设计,ER 关系图自动生成,降低建模门槛。
- ⚡ 智能 SQL 开发:支持语法高亮、代码补全、执行计划分析,查询效率提升 50%+。
- 独特优势 全中文支持:界面 / 文档 / 社区全面本土化,降低学习成本。
- 跨平台适配:Windows/macOS/Linux 全平台兼容。