Date: Sat, 18 Jun 2022 12:03:48 +0000 From: bugzilla-noreply@freebsd.org To: doc@FreeBSD.org Subject: [Bug 264751] Committer's Guide: `git config push.default freebsd` causes error Message-ID: <bug-264751-9@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264751 Bug ID: 264751 Summary: Committer's Guide: `git config push.default freebsd` causes error Product: Documentation Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Books & Articles Assignee: doc@FreeBSD.org Reporter: yasu@freebsd.org In the section 5.2.2.2 of Committer's Guide, There is following description. ---------------------------------------------------------------------- For pushing, either specify the full refspec: git push freebsd HEAD:refs/internal/admin Or set push.default to freebsd which will make git push to push the current branch back to its upstream by default, which is more suitable for our workflow: git config push.default freebsd ---------------------------------------------------------------------- However, in the git-config(1) man page of Git 2.36.1 `push.default` is explained as following. ---------------------------------------------------------------------- push.default Defines the action git push should take if no refspec is given (whether from the command-line, config, or elsewhere). Different values are well-suited for specific workflows; for instance, in a purely central workflow (i.e. the fetch source is equal to the p= ush destination), upstream is probably what you want. Possible values are: =E2=80=A2 nothing - do not push anything (error out) unless a = refspec is given. This is primarily meant for people who want to avoid mistakes by always being explicit. =E2=80=A2 current - push the current branch to update a branch= with the same name on the receiving end. Works in both central and non-central workflows. =E2=80=A2 upstream - push the current branch back to the branc= h whose changes are usually integrated into the current branch (which is called @{upstream}). This mode only makes sense if you are pushing to the same repository you would normally pull from (i.e. central workflow). =E2=80=A2 tracking - This is a deprecated synonym for upstream. =E2=80=A2 simple - pushes the current branch with the same nam= e on the remote. If you are working on a centralized workflow (pushing to the same repository you pull from, which is typically origin), t= hen you need to configure an upstream branch with the same name. This mode is the default since Git 2.0, and is the safest option suited for beginners. option suited for beginners. =E2=80=A2 matching - push all branches having the same name on= both ends. This makes the repository you are pushing to remember the set of branches that will be pushed out (e.g. if you always push maint and master there and no other branches, the repository you push to will have these two branches, and your local mai= nt and master will be pushed there). To use this mode effectively, you have to make sure all the branches you would push out are ready to be pushed out before running git push, as the whole point of this mode is to allow you to push all of the branches in one go. If you usually finish work on only one branch and push out the result, while other branches are unfinished, this mode is not for you. Also this mode is not suitable for pushing into a shared central repository, as other people may add new branches there, or update the tip of existing branches outside your control. This used to be the default, but not since Git 2.0 (simple is the new default). ---------------------------------------------------------------------- It means valid values are 'nothing', 'current', 'upstream', 'tracking', 'simple' and 'matching'. So setting it to 'freebsd' results in error. ---------------------------------------------------------------------- yasu@rolling-vm-freebsd2[1030]% git remote -v freebsd https://git.freebsd.org/ports.git (fetch) freebsd git@gitrepo.freebsd.org:ports.git (push) yasu@rolling-vm-freebsd2[1031]% git config push.default freebsd yasu@rolling-vm-freebsd2[1032]% git push error: malformed value for push.default: freebsd error: must be one of nothing, matching, simple, upstream or current fatal: bad config variable 'push.default' in file '.git/config' at line 30 yasu@rolling-vm-freebsd2[1033]% ---------------------------------------------------------------------- --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-264751-9>