DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • What Is Retesting?
  • Microservices Architecture: Advantages of Microservices
  • Beginner Intro to Real-Time Debugging for Mobile Apps: Tools and Techniques
  • Automated Multi-Repo IBM App Connect Enterprise BAR Builds
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Changing from Git Master to Main on Heroku

Changing from Git Master to Main on Heroku

Follow along with Michael, one of our core members as he walks through a quick tutorial on how to change git master to git main on Heroku.

Michael Bogan user avatar by
Michael Bogan
CORE ·
Jul. 28, 20 · Tutorial
Like (3)
Save
Tweet
Share
8.54K Views

Join the DZone community and get the full member experience.

Join For Free

I just saw that Heroku created the ability to git push heroku from main instead of master - and since I've been wanting to change my Git repos away from master anyway, I thought I'd check it out myself. Luckily, it was simple.

(For a little background info on the issue of master vs main in Git, see here)

I followed these 3 steps:

1. First I had to move my master branch to main using git checkout -b main:

 

2. Then I had to delete the old master branch using git branch -D master:

 

3. And now I can deploy from main using git push heroku main.

(Heroku builds and runs the pushed code as the latest version of your app)

 

That's it. Easy and fast, and no more master branches in my Git repo or Heroku builds.

master Git

Opinions expressed by DZone contributors are their own.

Trending

  • What Is Retesting?
  • Microservices Architecture: Advantages of Microservices
  • Beginner Intro to Real-Time Debugging for Mobile Apps: Tools and Techniques
  • Automated Multi-Repo IBM App Connect Enterprise BAR Builds

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: