什么是使用Git的常见反模式? [英] What are common antipatterns of using Git?

查看:115
本文介绍了什么是使用Git的常见反模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为Git新手,我意识到我一直在使用它,就好像它是Subversion一样。例如总是在master上工作,在提交更改之前不在本地提交等。这通常会导致可避免的手动合并情况。什么是使用Git的其他常见反模式?

解决方案

更改大球



当你编写提交信息时,你不知道应该在单行汇总变更中放入什么内容,这可能意味着你在一次提交中放置了太多独立的东西。最好使用 git rebase --interactive 和/或 git add --interactive 和朋友(比如 git stash --keep-index 来测试隐藏的更改)。



使用 git bisect 来尝试查找错误时,每次提交的单个问题将极大地帮助您。


As a Git newbie, I realized that I have been using it as if it were Subversion. e.g. always working on master, not committing locally before pulling changes etc. This often results in avoidable manual merge situations. What are other common antipatterns of using Git?

解决方案

Big ball of changes

When you are writing commit message, and you don't know what to put in single line summary of changes, it does probably mean that you put too many independent things in a single commit. Better to split commit into smaller, using "git rebase --interactive", and/or "git add --interactive" and friends (like "git stash --keep-index" to test stashed changes).

Having single issue per commit will help tremendously when trying to find bug using "git bisect".

这篇关于什么是使用Git的常见反模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆