GitHub is a code hosting platform for version control and collaboration. It enables users to work together on projects from remote locations. GitHub is widely popular among the web and application developer community. This open-source platform has a powerful community of talented coders, designers, and techies.
If you are unfamiliar with GitHub, this tutorial will help you to get started with it and teach you how to push your project to this virtual remote directory.
Create a GitHub account
- Go to GitHub Signup Page.
- Fill in your personal details, create a strong password, and hit the “Create an account” button.
- You will be asked to complete the CAPTCHA puzzle. Just follow on-screen instructions to prove that you are a real human and not a computer program.
- After that, you will be asked to choose a plan for the use of the GitHub repository. Click the Choose button to select your desired plan.
- Once you select the plan GitHub will send you an email confirmation message on your email address.
- Open your email inbox, you will see a message from GitHub.
- Open the message click on “Verify email address”. You will be redirected to the sign-up process page.
- Review your plan and hit the “Continue” button.
- After that, you will be displayed a quick survey that will help you to tailor your experience for what you are looking for. So, make selections according to that and hit the “Submit” button.
- Now you will be at GitHub’s home page.
If you want to create a new repository for your project you can do so by following the instructions given below:
Create a new repository
- To create a new repository, click on the ‘+’ sign located at the top-right corner of the GitHub site’s page.
- Set yourself as an owner, type repository name, and an optional description.
- Choose repository visibility and click “Create repository”.
Your repository is ready. You can upload your project to this directory.
But here we are going to push the local repository on GitHub.
Step 1: Open git bash
Git Bash is a command–line shell to enable git with a command-line of an operating system.
Users can interact with the repository and git elements through the commands.
Step 2: Change the Current Working Directory as your git repository
To change the current working directory, navigate to your project’s directory in the command-line shell, and hit enter.
Step 3: Initialize git repository
Initialize your current project directory as Git Repository.
To do so type command $ git init and hit enter.
Step 4: Add files to your local repository
Add files in your local repository with the command $ git add command.
This command stages the files for the first commit.
To unstage the file, type $ git reset HEAD FILE-NAME.
Step 5: Commit the files
Commit all the files with $ git commit -m “First commit” command.
This command commits the tracked changes and prepares the local repository to be pushed to a remote repository.
To remove this commit and modify the file type git reset –soft HEAD~1 and hit enter.
After modifying the file, you have to add the file with commit.
Step 6: Copy remote repository URL
There will be a link to a remote repository, at the top of your GitHub repository’s Quick Setup Page. Copy that link.
Step 7: Add URL in command prompt
In command prompt add copied URL for the remote repository where your local repository will be pushed.
$ git remote add origin remote repository URL
Paste your URL in place of the remote repository URL.
This command sets the new remote repository URL.
$ git remote -v
This command verifies the new remote URL.
Step 8: Push the changes made in your local repository to GitHub
$ git push origin master
This command pushes the changes made in your local repository up to the remote repository you specified as the origin.
Now your code is successfully uploaded on GitHub.
Conclusion
GitHub is the best friend of every developer. If you are starting your development journey, you will have to learn this most popular version controlling system. Here we tried to enlighten you about how to push your project to GitHub.
If you are looking for a software firm to create your business website or mobile app, your search ends here. We build affordable and robust software solutions for businesses to digitally thrive on. Contact us to get a quote. You can mail us at [email protected] or WhatsApp us on +91 95 37 84 38 39.
GitHub is a code hosting platform for version control and collaboration. It enables users to work together on projects from remote locations. GitHub is widely popular among the web and application developer community. This open-source platform has a powerful community of talented coders, designers, and techies.
If you are unfamiliar with GitHub, this tutorial will help you to get started with it and teach you how to push your project to this virtual remote directory.