During my early days of git usage, my config allowed me to simply type git push
instead of git push {origin} {branch_name}
which I need to now. Up until recently I needed to type out the long version...(I know)...which was incredibly annoying because I like using detailed branch names.
在使用git的初期,我的配置允许我直接输入git push
而不是我现在需要的git push {origin} {branch_name}
。 直到最近,我仍然需要输入长版本...(我知道)...这令人讨厌,因为我喜欢使用详细的分支名称。
I'd finally had enough of the copy and paste branch name madness and decided I wanted git push
to always push to my origin and the same branch name:
我终于受够了复制和粘贴分支名称的疯狂,并决定我想要git push
始终将其推送到我的来源和相同的分支名称:
git config --global push.default current
There are a number of you can use but in most cases, especially when you have a GitHub workflow, current
is likely the value you want to use. Also, since we're using --global
, this will be the default for all repositories!
您可以使用许多 ,但在大多数情况下,尤其是当您具有GitHub工作流程时, current
可能是您要使用的值。 另外,由于我们使用的是--global
,因此这将是所有存储库的默认设置!
翻译自: