Git - 掌握术语

发布于 2024-11-18 19:44:11 字数 752 浏览 0 评论 0 原文

好的,所以我已经通过了 教程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.?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

水染的天色ゝ 2024-11-25 19:44:11

originmaster 对 Git 来说没有特殊含义,它们只是约定。 origin 是“主要”远程存储库(尽管通常情况下,您会同时拥有 originupstream;前者是您的克隆,而upstream是团队的公共存储库)。 master 只是主分支的通用名称。根据项目的不同,它通常是合并测试版功能并推送错误修复的开发分支,尽管它可能是在其他地方进行开发的发布分支。

提交与推送在您链接的问题中进行了解释。请记住,如果您从 SVN 切换到 Git,“推送就是新的提交”(引用我的一位同事的话)。

你真的不需要“有条理地”学习其他人;边做边学。对于大多数人来说,Git 的内容太多,无法从书中记住。版本跟踪软件具有使错误可逆的特定目的;现在只需远离 --forcegit resetgit rebase 即可。

origin and master have no special meaning to Git, they're just conventions. origin is the "main" remote repo (although often, you'll have both an origin and an upstream; the former is your clone, while upstream 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 and git rebase for now.

蓦然回首 2024-11-25 19:44:11

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".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文