好的,所以我已经通过了 教程git 简介,我知道如何:
- 创建一个空的本地 .git 对象
数据库
- 添加整个内容
当前工作目录提交
- 添加内容
- 命名分支
- 创建远程存储库
- 推送 分支机构。
但在最初的学习过程中,我遇到了很多新术语。我认为理解这些术语的确切含义对于在处理实际项目时不犯不可挽回的错误至关重要。
您能否推荐一个好的资源来有条理地学习关键术语的含义,例如提交与推送,参考文献,头,克隆与结账等?
OK, so I got past the tutorial introduction to git and I know how to:
- Create an empty local .git object
database
- Add the contents of the entire
current working directory to it
- Commit the addition(s)
- Name a branch
- Create a remote repository
- Push branches.
But going through the initial learning process, I encountered many new terms. I feel that understanding the exact meaning of these terms is crucial to not making irreversible mistakes when working with a live project.
Can you recommend a good source for methodically learning the meaning of key terms like origin, master, commit vs. push, refs, heads, clone vs. checkout, etc.?
发布评论
评论(2)
origin
和master
对 Git 来说没有特殊含义,它们只是约定。origin
是“主要”远程存储库(尽管通常情况下,您会同时拥有origin
和upstream
;前者是您的克隆,而upstream
是团队的公共存储库)。master
只是主分支的通用名称。根据项目的不同,它通常是合并测试版功能并推送错误修复的开发分支,尽管它可能是在其他地方进行开发的发布分支。提交与推送在您链接的问题中进行了解释。请记住,如果您从 SVN 切换到 Git,“推送就是新的提交”(引用我的一位同事的话)。
你真的不需要“有条理地”学习其他人;边做边学。对于大多数人来说,Git 的内容太多,无法从书中记住。版本跟踪软件具有使错误可逆的特定目的;现在只需远离
--force
、git reset
和git rebase
即可。origin
andmaster
have no special meaning to Git, they're just conventions.origin
is the "main" remote repo (although often, you'll have both anorigin
and anupstream
; the former is your clone, whileupstream
is a team's common repo).master
is just a common name for the main branch. Depending on the project, it's usually the development branch where beta features are merged into and bugfixes are pushed to, though it may be a release branch with development occurring elsewhere.Commit vs. push is explained at the question you linked to. Just remember that, if you're switching from SVN to Git, "push is the new commit" (to quote a colleague of mine).
You don't really need to learn the others "methodically"; just learn by doing. There's too much to Git to memorize from a book for most mortals. Version tracking software has the specific purpose of making mistakes reversible; just stay clear of
--force
,git reset
andgit rebase
for now.在 DVCS 中学习的一个非常重要的术语是上游:
参阅““下游”和“上游”的定义”
请 CVCS(集中式 VCS)和 DVCS(分布式 VCS),关键是要意识到您拥有自己的存储库与许多“上游”存储库(从中您可以从获取)。
另一个需要很好掌握的概念是“rebase 与 merge”。
One term very important to learn in a DVCS is upstream:
See "Definition of “downstream” and “upstream”"
Considering the difference of workflow between a CVCS (Centralized VCS) and a DVCS (Distributed VCS), it is key to realize you have your repo vs. many "upstream" repos (from which you can fetch from).
The other notion to have a good grasp on is "rebase vs. merge".