What is github?
GitHub, Inc. is a provider of Internet hosting for software development and version control using Git. It offers the distributed version control and source code management functionality of Git, plus its own features.
What is git?
Git is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows.
Prerequisite.
- Github Account.
- Git installed and configured with your github account.
Getting started
My folder structure
Create repository in github.
- Create a new repository.
- Configure repository details.
Make repository name shorter that will result to short URL.
The repository has to be public unless you are a pro member in github. I have access to create private repository as I have pro member tag on my github profile.
- Commit the files
Start git bash and add these lines of code one by one.
git init
git add .
git commit -m 'my first commit'
git remote add origin https://github.com/{username}/{repository name}.git
git push -u origin master
Refresh the github repository page and you will see all files.
Configure github pages.
Go to settings.
- Go to pages.
- Select branch and save it.
You will get redirected
- Your work is done
Refresh the page and you will see the deployed link.
Top comments (8)
The repo has to be public unless you are a pro member , you might as well mention that.
Thankyou @pandademic
I can create private repositories on my account and I do not have a pro membership though.
Yes but you can't enable github pages on them
Nice post. I recently started to combine Cloudflare pages and GitHub pages which add many extra functionalities, still all automated and easy to deploy.
Example z-shell.pages.dev/docs/code
Glad it helps.
Thank you for the tutorial, I hope to make some quick static pages right now
Glad it helps.