Skip to main content

Command Palette

Search for a command to run...

Upload your project on Github using Git

Updated
2 min read
Upload your project on Github using Git
V

I am a Full Stack Developer from Mumbai, India. Currently I'm pursuing my Bachelors in Computer Science.

Hello fellow developer, are you still using drag and drop to upload your project on Github? Today I'll walk you through git and answer questions like what is git and why it is a better option than drag and drop.

What is git?

Git is an open source software that helps you to keep track of all the changes you make in your code. Adding a new file, deleting a file, altering code all this changes are tracked by git. Hence it is also called as a version control software.

Why use git?

Do you remember making files like reactProject1, reactProject2 of the same project. Let's admit we all did this at some point while development. You can avoid this by initializing git in you project. By doing this you can access all the versions of your codebase rather than creating a separate file for the same.

Note: At many companies, developers who use git are preferred.

We now have basic knowledge of Git, let's use it.

Using Git

1. Installation

Download Git from this page -> download and then Install Git on you computer

2. Create a new Github repository

image.png

image.png

4. Right click the mouse button and choose "Git Bash Here"

image.png

5. Initialize an empty git repository

Navigate to you project folder and use git init

image.png

Use the Github repository link in this command

git remote add origin "link"

image.png

7. Use git add .

This command will add all of your project files to git so you can track any changes made from here on out.

image.png

use git status to check whether the files are add successfully

8. Commit the changes

Note: Use git branch -m main to change the name of your branch if your default branch name is master.

By using git commit -m "message" you can commit your changes with a message.

image.png

9. Uploading the project

With git push origin main your project will be uploaded Github

image.png

Refresh the github page

image.png

Congratulations 🥳 you've uploaded your project on Github using git.

Conclusion

Using Git correctly is a skill in itself, it also helps you to contribute in open source projects. I hope you learned something new today.

I appreciate your time. See you in another blog. Bye👋