什么是使用Git的常见反模式? [英] What are common antipatterns of using 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屋!