Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion Using Your Own Domain Name

Carlos Enrique Castañeda Gutiérrez
Carlos Enrique Castañeda Gutiérrez
13,886 Points

Why CNAME was commited on Master Branch?

Hello everybody:

I'm assuming the web on the video is a "project website" not "user website". I was wondering why the CNAME was commited to the Master branch when the "live" branch is "gh-pages". It shoudn't make more sense to commited on gh-pages because how the domain provider read the CNAME if this file is in a non-live branch (Master)?

Thanks

3 Answers

I know this is a little old but in this video it is a user website, not a project website.

You can see at 2:45 the repository name of guilh.github.io

Dear Carlos Enrique Castañeda Gutiérrez,
You're assuming right. And Tom Hughes, has answered it already. In fact, I wondered about it for a while too. But then, I realized that this time the instructor, Guil, was not using GitHub pages for a repo, rather a user website. And earlier in the course, he said that "user websites" don't need to be on a gh pages branch. They are meant to be in their "master" branch. That's why the CNAME was committed to the master branch. When you'll be working on a project site, you'll be committing to the gh-pages. Hope that clears the matter up a bit more. Happy Coding :smile:

Dilip Agheda
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Dilip Agheda
Full Stack JavaScript Techdegree Graduate 28,581 Points

You don't have to commit on your gh-pages branch even for your project pages. It is merely a convention that was followed in the video to prevent all changes to the master going live.

On github repo, if you go to settings menu option, you will see section for git hub pages. you can select your master branch there if you want to and no need to even create any branches. I have done the same as well.