Closed jwhitlock closed 3 years ago
Not everything ships git 2.2.8 yet so you need to account for that. Just because Github changed its default, doesn't mean you need to follow it. I think that in terms of support you don't really need to do anything right now for the best result during workshops. AFAIK the current instructions still work.
Here is the current list of platforms and the git version they use or available for download or installation:
Platform | Platform version / URL | Git version |
---|---|---|
source | https://github.com/git/git | 2.29.2 |
download | https://git-scm.com/downloads | 2.29.2 |
windwos | 2.29.2 | |
brew | 2.29.2 | |
macport | 2.29.2 | |
mac-dmg | https://sourceforge.net/projects/git-osx-installer/ | 2.27.0 |
debian | jessie 8 | 2.1.4 |
stretch 9 | 2.11.0 | |
buster 10 | 2.20.1 | |
bullseye 11 | 2.28.0 | |
sid - developing | 2.29.2 | |
ubuntu | xenial (16.04LTS) | 2.7.4 |
bionic (18.04LTS) | 2.17.0 | |
focal (20.04LTS) | 2.25.1 | |
groovy (20.10LTS) | 2.27.0 | |
fedora | Fedora 31 | 2.23.0 |
Fedora 32 | 2.26.2 | |
Fedora 33 | 2.28.0 | |
Fedora 34 | 2.29.2 | |
archlinux | 2.29.2 | |
mx-linux | 2.27.0 | |
manjaro | 2.25.1 |
More versions of Git in different distributions and package repositories can be found on repology. It doesn't look like assuming Git ≥ 2.2.8 would be problematic.
https://wiki.debian.org/LTS says
Debian LTS support for Debian 8 "Jessie" ended on June 30, 2020
so we I guess we can safely ignore what Git version Debian 8 "Jessie" provides.
In July 2020, git 2.2.8 introduced a new config item
init.defaultBranch
that could be used to sync the user's new repository to the GitHub default. Starting our Git repository could be updated to set this, and re-arranged to set all config before init:More versions of Git in different distributions and package repositories can be found on repology. It doesn't look like assuming Git ≥ 2.2.8 would be problematic.
Hmm ... Though I've now noticed that the option was introduced in Git 2.28, not Git 2.2.8!
So we should probably wait till Git 2.28 is more widespread.
One way to switch to main
as the default branch would be to simply rename it as suggested by GitHub on the page of a freshly-created, still empy repo:
git branch -M main
should work on all versions of Git still in use. And as (on the client-side) there's nothing special about the default branch, except that it's created initially, renaming it should really be all that's needed.
See also https://github.com/DjangoGirls/tutorial/pull/1585#discussion_r523420052
Related Pull Request: #1742
Related Pull Request: #1742
Guidance from #1676 has been applied to PR #1742
As of October 1, 2020, GitHub defaults to
main
as the the default branch for new projects. This means a few screenshots and instructions may be out of date.Even though both
main
andmaster
are English words, this change is being applied for all users, so it should affect all languages and operating systems.In July 2020, git 2.2.8 introduced a new config item
init.defaultBranch
that could be used to sync the user's new repository to the GitHub default. Starting our Git repository could be updated to set this, and re-arranged to set all config before init:There are additional changes that would be needed.
git status
would now say you are on branchmain
instead ofmaster
, the push command would begit push -u origin main
, etc. There would also be new screenshots, and there may be changes to the PythonAnywhere deploy.This repository could also make the change from
master
tomain
, but I think that could be tracked as a separate issue.