[GitHub] - How to host your sandbox code on GitHub - | SheCodes

[GitHub] - How to host your sandbox code on GitHub

Learn how to host your sandbox code on GitHub step-by-step with this guide: create a repository, clone it to local, commit, push and pull.

👩‍💻 Technical question

Asked 2 years ago in GitHub by Kateryna

How can I host my sandbox code on GitHub? Thanks!

🤖 SheCodes Athena says:

Answered in 41.9 seconds

You can host your sandbox code on GitHub by creating a new repository and cloning it to your local machine. First, go to the GitHub website and create an account if you don't already have one.

Once you've created an account, you can create a new repository on GitHub by clicking the + icon in the top right and selecting New repository. Once your repository is created, it should give you an HTTPS URL for you to clone it to your local machine.

To clone the repository, you can use the git clone command followed by the repository URL. On the terminal, run:

code
Copy code
git clone https://github.com/<your username>/<your repository name>.git

After running git clone, the files in the repository should be cloned to your local machine. You can then make any desired changes to the repository and push it to GitHub using git commit, git push, and git pull.

For more information on hosting your code on GitHub, check out the official GitHub Guide here.

More coding questions about GitHub

👩‍💻 Technical question

How can I get my respiratory GitHub link

🤖 SheCodes Athena says:

Answered in 2.66 seconds

If you want to retrieve a link to your GitHub repository's respiratory system, you need to follow these steps:

  1. Open your GitHub account and go to your repository page.

  2. Click on the 'Code' button located at the top right of the page.

  3. Under the 'Clone' options, click on the 'HTTPS' dropdown menu to reveal the repository's respiratory link.

Example respiratory GitHub link:

https://github.com/exampleusername/example-repo.git```
Copy code
Keep in mind that this link allows access to your project's source code, so make sure to keep it private and only share it with trusted individuals.

👩‍💻 how can I make the account public

🤖 SheCodes Athena says:

Answered in 3.14 seconds

To make your GitHub account public, you can follow these steps:

  1. Open your GitHub account and sign in.

  2. Click on your profile picture located at the top right corner of the page.

  3. From the dropdown menu, select 'Settings'.

  4. Once on the settings page, scroll down to the 'Visibility' section.

  5. Under the 'Visibility' section, click on the 'Change visibility to public' button.

  6. A warning message will appear asking you to confirm that you understand the implications of making your account public. Read the message carefully and make sure you understand it. If you're sure you want to proceed, type "public" in the text field and click on 'I understand, change my visibility'.

That's it! Your account will be set to public and anyone will be able to view your profile, repositories, and contributions.

👩‍💻 Technical question

Asked 2 years ago in GitHub by Veronika

I need to deploy my project from private repository github to gh-pages. My project is builded with webpack

🤖 SheCodes Athena says:

Answered in 3.67 seconds

To deploy a project from a private repository on GitHub to gh-pages, you can follow these general steps:

  1. Create a new branch called "gh-pages" in your GitHub repository
  2. Build your project locally using webpack
  3. Copy the resulting build files to the new "gh-pages" branch
  4. Commit and push the changes to the "gh-pages" branch
  5. Enable GitHub Pages on the "gh-pages" branch in the repository settings

Here are a few more detailed steps:

  1. Create a new branch called "gh-pages" in your GitHub repository
code
Copy code
git checkout --orphan gh-pages
  1. Build your project locally using webpack
code
Copy code
webpack --config webpack.config.prod.js
  1. Copy the resulting build files to the new "gh-pages" branch
code
Copy code
cp -r dist/* .
  1. Commit and push the changes to the "gh-pages" branch
code
Copy code
git add . git commit -m "Initial gh-pages commit" git push origin gh-pages
  1. Enable GitHub Pages on the "gh-pages" branch in the repository settings

For more information, you can check out this guide on GitHub Pages: https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site#creating-your-site

👩‍💻 Technical question

Hi, how can I return to one of my previous commits in GitHub and open it in Visual Studio Code?

🤖 SheCodes Athena says:

Answered in 16.92 seconds

You can view your previous commits in GitHub and open them in Visual Studio Code with the following steps:

  1. Go to your GitHub repository.
  2. Click "Commits".
  3. Select a specific commit.
  4. At the top of the page, you'll see a button saying "open in Desktop".
  5. Select the Visual Studio Code option.
  6. You'll be prompted to open the repository in Visual Studio Code.
  7. The repository will open in Visual Studio Code with the commit selected.

Here is an example: https://docs.github.com/en/enterprise/2.18/user/articles/opening-a-terminal-in-visual-studio-code