I've had to deal with projects where the "main" branch was named: master, main, blead.
I almost never "name" that "main" branch, thanks to commands and aliases. When I want to pull (and rebase) to the "main" branch, I run "git prom". When I want to check out the "main" branch, I "git com". What actually happens depends on what the project's "main" branch is. If a project later moves to a "live" branch, I'll just update the "git-main" script to detect it ahead of the rest, and off I go. https://github.com/mfontani/los-opinionated-git-tools/blob/m... is less than ten lines of bash. git-com is really just: git checkout "$(git main)" git-prom is really just: git pull --rebase origin "$(git main)" I'm not particularly sold on "main" vs "master" being an important thing, but if it's important to some I at least want to ensure I don't get frustrated when interacting with a project which uses it. With the above aliases and functions and programs, I don't care anymore. main, master, blead... call it whatever.
I teach 2 git classes each year. I used to use GitHub for the pull/push section of the class, but last autumn half the class got stuck with branch name mismatches.
I switched to GitLab in the next class. Surely this is just anecdata, but it seems to me that there can be real commercial consequences to letting your business get hijacked by the thought police.
Wait, I need to explain details of remotes and named branches before a basic collaboration exercise because some angry lefties in California got offended? Come on. Git can be very overwhelming to new users. Any concept I can leave undiscussed before people can get their hands dirty is a win. GitHub forces me to add a concept for political reasons.
Comments (2,007) 300 threads
Earlier commentshttps://www.britannica.com/topic/race-human/The-history-of-t...
Its 2021 and we're thoroughly adamant on tribalism.
I almost never "name" that "main" branch, thanks to commands and aliases.
When I want to pull (and rebase) to the "main" branch, I run "git prom". When I want to check out the "main" branch, I "git com". What actually happens depends on what the project's "main" branch is. If a project later moves to a "live" branch, I'll just update the "git-main" script to detect it ahead of the rest, and off I go.
https://github.com/mfontani/los-opinionated-git-tools/blob/m... is less than ten lines of bash.
git-com is really just: git checkout "$(git main)"
git-prom is really just: git pull --rebase origin "$(git main)"
I'm not particularly sold on "main" vs "master" being an important thing, but if it's important to some I at least want to ensure I don't get frustrated when interacting with a project which uses it. With the above aliases and functions and programs, I don't care anymore.
main, master, blead... call it whatever.
I switched to GitLab in the next class.
Surely this is just anecdata, but it seems to me that there can be real commercial consequences to letting your business get hijacked by the thought police.
All comments shown.
Couldn't load more comments. Check your connection and try again.