Re: [Python-Dev] Re: [Release management] schedule for renaming the default branch
Hi Serhiy,
On Thu, Mar 11, 2021 at 8:33 AM Serhiy Storchaka <storchaka@gmail.com> wrote:
I have above 200 feature branches in my local repository. Will renaming the master branch cause any problems?
I don't think that you need to do anything on your machine nor on your open PRs.
When I use "git switch -c new_branch" command to create a new branch, the created branch doesn't "track" its parent branch by default. Example:
$ git branch -vv (...)
- gilstate_init a6959b8971 bpo-43311: Create GIL autoTSSkey ealier master 9a9c11ad41 [upstream/master] bpo-43287: Use PEP 590 vectorcall to speed up filter() (GH-24611)
My "gilstate_init" local branch doesn't track any branch, whereas my local "master" branch tracks upstream/master (my upstream remote is git@github.com:python/cpython.git).
Usually, when I want to easily see the differences between a local branch and my local master branch (to use my "git out" alias), I type "git branch --set-upstream-to=master":
$ git switch gilstate_init $ git branch --set-upstream-to=master $ git out a6959b8971 bpo-43311: Create GIL autoTSSkey ealier
where my "git out" alias is the command:
$ git log '@{upstream}..' --pretty='format:%Cred%h%Creset %s' --color --reverse
You can check that gilstate_init now tracks my local master branch:
$ git branch -vv (...) gilstate_init a6959b8971 [master: ahead 1] bpo-43311: Create GIL autoTSSkey ealier master 9a9c11ad41 [upstream/master] bpo-43287: Use PEP 590 vectorcall to speed up filter() (GH-24611)
Use "git switch -c new_branch --track master" to create a new branch based on master which tracks the master branch.
Maybe I should track upstream/master rather than my local master branch, but when I fetch the upstream remote, I always update my local master branch, so in my case, it's the same in pratice :-) And "master" is shorter to type than "upstream/master".
Victor
Night gathers, and now my watch begins. It shall not end until my death.
participants (1)
-
Victor Stinner