python / python/devguide

Documenting pushdefault config option

未关闭
#257 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

topic-git type-feature
主要语言
Python
星标
2.1k
派生
1k
平均合并
2 天 12 小时
30 天内合并 PR
12

描述

There seem to be 3 variations of the git push command:

  1. Use git push origin branchname and always specify the remote and the branch
  2. Use git push -u origin branchname on the first push to set origin as the default and then just use git push
  3. Set the pushdefault to origin in .git/config and just use git push

The first method is the one suggested in the devguide
(e.g. in the submitting section); the second is also documented in the pushing changes section; the third is apparently somewhat recent and not yet documented.

The pushdefault is configured by adding to .git/config:

[remote]
    pushdefault = origin

Where origin refers to the user's fork of cpython. AFAICT almost all the pushes should go to origin.

Each method has pros and cons:

First method:

  • pros: explicit is better than implicit
  • cons: longer to type, harder to remember, could get the arg names/order wrong

Second method:

  • pros: still explicit but shorter to type for the following pushes
  • cons: same as above but only applies to the first push on each branch

Third method:

  • pros: easier to remember, shorter to type, works like hg push
  • cons: less explicit

The question is: which one should we adopt as the recommended method?

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

查看 devguide 中链接的 submitting 和 pushing changes 部分,以及 .git/config 中的 pushdefault 示例。比较文档中介绍的三种工作流,确定指南应推荐哪种方法,然后更新相关文档,明确这一选择及其设置方式。

由索引模型根据 Issue 内容生成。

评估

技术栈
git
领域
documentation
Issue 类型
文档
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。