88[ ![ Gem Version] ( https://badge.fury.io/rb/git.svg )] ( https://badge.fury.io/rb/git )
99[ ![ Documentation] ( https://img.shields.io/badge/Documentation-Latest-green )] ( https://rubydoc.info/gems/git/ )
1010[ ![ Change Log] ( https://img.shields.io/badge/CHANGELOG-Latest-green )] ( https://rubydoc.info/gems/git/file/CHANGELOG.md )
11- [ ![ 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 )
11+ [ ![ 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 )
1212[ ![ Conventional Commits] ( https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white )] ( https://conventionalcommits.org )
1313
1414- [ 📢 We've Switched to Conventional Commits 📢] ( #-weve-switched-to-conventional-commits- )
@@ -275,8 +275,8 @@ g.branches # returns Git::Branch objects
275275g.branches.local
276276g.current_branch
277277g.branches.remote
278- g.branches[:master ].gcommit
279- g.branches[' origin/master ' ].gcommit
278+ g.branches[:main ].gcommit
279+ g.branches[' origin/main ' ].gcommit
280280
281281g.grep(' hello' ) # implies HEAD
282282g.blob(' v2.5:Makefile' ).grep(' hello' )
@@ -333,7 +333,7 @@ Git.ls_remote('https://github.com/ruby-git/ruby-git.git') # returns a hash conta
333333Git .ls_remote(' /path/to/local/repo' )
334334Git .ls_remote() # same as Git.ls_remote('.')
335335
336- Git .default_branch(' https://github.com/ruby-git/ruby-git' ) # => 'master '
336+ Git .default_branch(' https://github.com/ruby-git/ruby-git' ) # => 'main '
337337```
338338
339339And here are the operations that will need to write to your git repository.
@@ -406,13 +406,13 @@ g.branch('new_branch') # creates new or fetches existing
406406g.branch(' new_branch' ).checkout
407407g.branch(' new_branch' ).delete
408408g.branch(' existing_branch' ).checkout
409- g.branch(' master ' ).contains?(' existing_branch' )
409+ g.branch(' main ' ).contains?(' existing_branch' )
410410
411411# delete remote branch
412412g.push(' origin' , ' remote_branch_name' , force: true , delete: true )
413413
414414g.checkout(' new_branch' )
415- g.checkout(' new_branch' , new_branch: true , start_point: ' master ' )
415+ g.checkout(' new_branch' , new_branch: true , start_point: ' main ' )
416416g.checkout(g.branch(' new_branch' ))
417417
418418g.branch(name).merge(branch2)
@@ -422,7 +422,7 @@ g.branch(name).in_branch(message) { # add files } # auto-commits
422422g.merge(' new_branch' )
423423g.merge(' new_branch' , ' merge commit message' , no_ff: true )
424424g.merge(' origin/remote_branch' )
425- g.merge(g.branch(' master ' ))
425+ g.merge(g.branch(' main ' ))
426426g.merge([branch1, branch2])
427427
428428g.merge_base(' branch1' , ' branch2' )
0 commit comments