On May 3, 2021, at 19:45, Tim Peters <tim.pet...@gmail.com> wrote:
> Blob 1 ("origin"):
> 
> """
> You just need to update your local clone after the branch name changes.
> From the local clone of the repository on a computer,
> run the following commands to update the name of the default branch.
> 
> $ git branch -m master main
> $ git fetch origin
> $ git branch -u origin/main main
> 
> Apart from that, you should update any local script or command that uses
> the name "master" to use the name "main".
> """
> 
> Blob 2 ("upstream"):
> 
> """
> The CPython repository's default branch was renamed from ``master`` to 
> ``main``
> after the Python 3.10b1 release. If you had cloned the repository before this
> change, you can rename your local branch as follows::
> 
>    git branch -m master main
>    git fetch upstream
>    git branch -u upstream/main main
> """
> 
> From my dim understanding, "upstream" makes more sense, but I don't
> know. On my box:
> 
> """
> $ git remote -v
> origin  https://github.com/tim-one/cpython (fetch)
> origin  https://github.com/tim-one/cpython (push)
> upstream        https://github.com/python/cpython (fetch)
> upstream        https://github.com/python/cpython (push)
> """
> 
> so sync\ing with the universally shared "upstream" just makes more sense to 
> me.

If you are using the 'pull from "upstream", push to "origin"' naming convention 
that GitHub recommends, yes, Blob 2 is likely what you want to do so that "git 
pull" by default pulls from "upstream".  If you executed Blob 1 by mistake, 
just doing 'git branch -u upstream/main main' should fix things up unless you 
have pushed commits to the master->main branch in your GitHub clome pointed to 
by "origin"; in that case, you may get a request to merge the two branches 
which you probably don't want to do. In that case, you may need to rename the 
branch in your origin clone (which is seldom a good idea for cpython since you 
aren't able to push directly to the main cpython repo) or use git log and git 
reset --hard to remove the offending commits, if you don't need them. If you 
have work-in-progress you don't want to lose, don't delete anything: it's 
probably easily salvageable!

--
  Ned Deily
  n...@python.org -- []

_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/OARMR5AKNYY5EWVFDKO7DUPJOHWXFHJD/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to