工具推荐: 版本控制
目录
Git
- Fork
- https://git-fork.com/
- 支持系统:Windows/macOS
- Tower
- https://www.git-tower.com/
- 支持系统:Windows/macOS
- 付费
- Github Desktop
- https://github.com/apps/desktop
- 支持系统:Windows/macOS/Linux
- 开源/免费
- SourceGit
- https://github.com/sourcegit-scm/sourcegit
- 支持系统:Windows/macOS/Linux
- 开源/免费
Subversion
- SmartSVN
- https://www.smartsvn.com/
- 支持系统:Windows/macOS/Linux
- 付费
- RapidSVN
- http://rapidsvn.tigris.org/
- 支持系统:Windows/macOS/Linux
- 开源/免费
个人推荐
Git 图形客户端
根据我的使用经验,推荐以下工具:
GitHub Desktop:最适合初学者和 GitHub 用户
- 界面简洁,学习成本低
- 与 GitHub 集成度最高
- 开源免费
Fork:功能强大且美观
- 支持高级 Git 操作
- 界面设计现代化
- 性能优秀
SourceGit:轻量级开源选择,不过我不喜欢这个,丑和不好用。
- 跨平台支持
- 功能全面
- 社区活跃
Git 常用配置
设置用户信息
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"设置默认分支名
git config --global init.defaultBranch main设置编辑器
git config --global core.editor "code --wait"启用颜色输出
git config --global color.ui auto常用 Git 别名
# 简化常用命令
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1'
git config --global alias.visual 'log --graph --oneline --all --decorate'推荐的工作流
Git Flow 工作流
适用于需要管理发布周期的项目:
# 安装 git-flow
brew install git-flow # macOS
apt install git-flow # Linux
# 初始化
git flow init
# 创建功能分支
git flow feature start feature-name
# 完成功能分支
git flow feature finish feature-name简化工作流
适用于个人项目或小团队:
# 创建功能分支
git checkout -b feature-name
# 提交更改
git add .
git commit -m "描述更改"
# 推送到远程
git push -u origin feature-name
# 合并到主分支
git checkout main
git merge feature-name
git push origin main其他资源
这篇文章记录了我常用的版本控制工具和配置。选择合适的工具可以提高开发效率,建议根据自己的需求和使用习惯进行选择。