Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7041225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:00:48+00:00 2026-05-28T02:00:48+00:00

username.github.com/repo-name Instructions for setting up username.github.com/repo-name * cd /path/to/repo-name git symbolic-ref HEAD refs/heads/gh-pages rm

  • 0

username.github.com/repo-name

Instructions for setting up username.github.com/repo-name *

cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
git add .
git commit -a -m "First pages commit"
git push origin gh-pages

I did this : cd /path/to/repo-name
After I did git clean -fdx, all my files got deleted. I had to download them from github.

Was this (cd /path/to/repo-name) meant to be on a new directory ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:00:49+00:00Added an answer on May 28, 2026 at 2:00 am

    The commands that you are seeing are meant to create an empty branch gh-pages.

    It is not meant to be a new directory, but a new branch, with no link to your master and other branches and add the github pages related content in there. It must have been done as a first step, but you might have done it after adding files, which might be fine. Read the instructions on the gh-pages wiki. It explains why the above commands were needed and also warns that you will lose the files, like you did – http://pages.github.com/

    You can also use git checkout --orphan gh-pages as an alternative.

    See my answer here: How do I create a commit without a parent in Git?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I did : git add remote git@github.com:username/name_of_github_repo.git git push -u github master It returns
$ git remote -v (null) git@github.com:username/Savvy.git (fetch) (null) git@github.com:username/Savvy.git (push) origin git@github.com:username/SavvyCode.git (fetch) origin
I you have a github account with Jekyll-rendered pages at: username.github.com is it possible
I followed these instructions from GitHub web page to create a first repo; Global
For example if you go to https://github.com/signup/free And type 'john' into username, a small
If you have a site called http://username.github.com and a project called projectname , do
my author name in all my commits is coming up as unknown https://github.com/freeenergy/Teacher-Login-Validation-Module did
I am following the guidelines published here: http://develop.github.com/p/repo.html I am trying to add a
I am trying to setup git on my Mac through this link ( http://help.github.com/mac-set-up-git/
$git push origin master To git@github.com:dimitar9/first_app.git ! [rejected] master -> master (non-fast-forward) error: failed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.