-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prepare to rename default branch to main #3462
Conversation
- update references to default branch name in docs, workflows - use HEAD in github urls, which always works regardless of default branch name - fix petstore URLs since the old petstore links seem to have stopped working
The diff looks good to me. I think the "risk" of merging this is that there are occurrences of There will be stuff we miss but the quickest way to find it will be to make the switch and then clean up as we go along (I think). Took a quick look at https://github.com/minrk/git-stuff/blob/main/bin/git-default-branch but not quite sure what it does. Is it a helper script to switch my local checkout (and my fork) to |
It just returns the name of the default branch, i.e. The idea is wherever you would type 'master' or 'main', which assumes you know what the default branch is, you put alias m='git checkout $(git default-branch)'
alias mp='git checkout $(git default-branch) && git pull'
alias rebase='git rebase -i origin/$(git default-branch)' so I don't have to change anything I actually type into the terminal based on the repo's default branch.
GitHub's own docs have this:
Having more detailed instructions is hard because there are so many ways to use git (e.g. upstream=canonical, origin=my fork vs my personal preference: origin=canonical, mine=my fork). Covering them all doesn't seem feasible to me.
and forks is interesting: I've never used the default branch on a fork. That doesn't make a lot of sense to me, so I don't feel like there's anything to do there. You can have your own fork's default branch be whatever you like, and it should be unaffected by the default branch of this repo. |
- update references to default branch name in docs, workflows - use HEAD in github urls, which always works regardless of default branch name - fix petstore URLs since the old petstore links seem to have stopped working to merge, in order: - [x] approve this PR - [x] rename the default branch to main in settings - [x] merge this PR Related tangent: I've been using [this git default-branch](https://github.com/minrk/git-stuff/blob/main/bin/git-default-branch) to help with my aliases and friends working with repos with different branch names. Signed-off-by: Min RK <[email protected]>
to merge, in order:
Related tangent: I've been using this git default-branch to help with my aliases and friends working with repos with different branch names.