Skip to content

Update the project's default branch from 'master' to 'main' #802

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

Merged
merged 1 commit into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Review our [guidelines for contributing](https://github.com/ruby-git/ruby-git/blob/master/CONTRIBUTING.md) to this repository. A good start is to:
Review our [guidelines for contributing](https://github.com/ruby-git/ruby-git/blob/main/CONTRIBUTING.md) to this repository. A good start is to:

* Write tests for your changes
* Run `rake` before pushing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
pull_request:
branches: [master]
branches: [main]
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enforce_conventional_commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:
on:
pull_request:
branches:
- master
- main

jobs:
commit-lint:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/experimental_continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI Experimental

on:
push:
branches: [master]
branches: [main]

workflow_dispatch:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |

on:
push:
branches: ["master"]
branches: ["main"]

workflow_dispatch:

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Gem Version](https://badge.fury.io/rb/git.svg)](https://badge.fury.io/rb/git)
[![Documentation](https://img.shields.io/badge/Documentation-Latest-green)](https://rubydoc.info/gems/git/)
[![Change Log](https://img.shields.io/badge/CHANGELOG-Latest-green)](https://rubydoc.info/gems/git/file/CHANGELOG.md)
[![Build Status](https://github.com/ruby-git/ruby-git/workflows/CI/badge.svg?branch=master)](https://github.com/ruby-git/ruby-git/actions?query=workflow%3ACI)
[![Build Status](https://github.com/ruby-git/ruby-git/workflows/CI/badge.svg?branch=main)](https://github.com/ruby-git/ruby-git/actions?query=workflow%3ACI)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)

- [📢 We've Switched to Conventional Commits 📢](#-weve-switched-to-conventional-commits-)
Expand Down Expand Up @@ -275,8 +275,8 @@ g.branches # returns Git::Branch objects
g.branches.local
g.current_branch
g.branches.remote
g.branches[:master].gcommit
g.branches['origin/master'].gcommit
g.branches[:main].gcommit
g.branches['origin/main'].gcommit

g.grep('hello') # implies HEAD
g.blob('v2.5:Makefile').grep('hello')
Expand Down Expand Up @@ -333,7 +333,7 @@ Git.ls_remote('https://github.com/ruby-git/ruby-git.git') # returns a hash conta
Git.ls_remote('/path/to/local/repo')
Git.ls_remote() # same as Git.ls_remote('.')

Git.default_branch('https://github.com/ruby-git/ruby-git') #=> 'master'
Git.default_branch('https://github.com/ruby-git/ruby-git') #=> 'main'
```

And here are the operations that will need to write to your git repository.
Expand Down Expand Up @@ -406,13 +406,13 @@ g.branch('new_branch') # creates new or fetches existing
g.branch('new_branch').checkout
g.branch('new_branch').delete
g.branch('existing_branch').checkout
g.branch('master').contains?('existing_branch')
g.branch('main').contains?('existing_branch')

# delete remote branch
g.push('origin', 'remote_branch_name', force: true, delete: true)

g.checkout('new_branch')
g.checkout('new_branch', new_branch: true, start_point: 'master')
g.checkout('new_branch', new_branch: true, start_point: 'main')
g.checkout(g.branch('new_branch'))

g.branch(name).merge(branch2)
Expand All @@ -422,7 +422,7 @@ g.branch(name).in_branch(message) { # add files } # auto-commits
g.merge('new_branch')
g.merge('new_branch', 'merge commit message', no_ff: true)
g.merge('origin/remote_branch')
g.merge(g.branch('master'))
g.merge(g.branch('main'))
g.merge([branch1, branch2])

g.merge_base('branch1', 'branch2')
Expand Down
2 changes: 1 addition & 1 deletion bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require 'bundler/setup'

`git config --global user.email "git@example.com"` if `git config --global user.email`.empty?
`git config --global user.name "GitExample"` if `git config --global user.name`.empty?
`git config --global init.defaultBranch master` if `git config --global init.defaultBranch`.empty?
`git config --global init.defaultBranch main` if `git config --global init.defaultBranch`.empty?

project_root = File.expand_path(File.join(__dir__, '..'))

Expand Down