2024-02-19
Every developer needs a secure place where they can store their project. GitHub is the right platform to do that.
Blog post by MF Mabala
Using GitHub to store Projects
GITHUB
GitHub is a website and cloud-based service that helps developers store and manage their code, as well as track and control changes to their code. You are able to track the entire history of changes made to your project.
Pushing a project to GitHub
Developers use code editors to write code and develop projects and the mostly used editor is VSCODE. All information provided in this blog will be based on VSCODE and windows.
Creating a github account
To set up a github account you need to register on the link below and follow all the instruction and verify you account.
https://github.com/join
Creating a new repository.
Repository- is a place where you can store your code, files and the revision history of each file. Now after registering and verifying your GitHub account you can now login using the login details you used while setting the account.
The second step will be to create a new repository. When You are on the homepage you will see a Create new Repository option in the middle of your home page. Now follow the following instructions .
-Repository name- give it any name you like, but it is advisable to give it a name similar to your project.
-Give a description
-Make it public
-add a README file
-create Repository
Everything I did not mention in the instructions you leave them as they are . Now you have a Repository that you can push your code to.
Pushing your code into your repository for the first time.
After creating the new repository you will be directed to a page that looks like this:
The commands and link that you need to be able to push your code are listed above
It may happen sometimes that after creating the repository you are directed to a different page other than the one above . This is how you will get access to the link. The picture of the page will look something like this . The link is accessed on the line written code below.
- Finally we can push the project with the following commands. Replace the link with you own repository link.
-git-init
-git commit -m 'first commit'
-git branch -M main
-git remote add origin https://github.com/KhomotjoMM/doooou.git
-git push -u origin main