Hey Guys!!!
My name is Atharva and I am a high school student, interested in the world of development. This blog is a part of the "Open Source" track. In this blog, I will be sharing how I made my first ever (small-scale) repository on GitHub and how you can make your repository as you learn more things and are ready for the outside world.
Link to my repository: github.com/the-amazing-atharva/Hello-World-..
Some Snippets :
But before we begin, make sure you have a GitHub account and Git Bash installed on your computer. If you don't have one, you can easily create an account on GitHub.com and download Git Bash here.
Let's Begin!!!
Let's start by creating our first C++ program :
Open your favourite text editor and create a new file called "hello.cpp".
Type the following code into the file:
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
Save the file in a directory of your choice.
This will be the location of your local repository.
Snippet :
Adding it to Github :
Open Git Bash in the same directory as the "hello.cpp" file.
Initialize a new local repository by running the command :
$ git init
- Add the "hello.cpp" file to the repository by running the command :
$ git add hello.cpp
- Commit the changes with a commit message by running the command :
$ git commit -m "Initial commit: Hello World program"
Now that our code is ready in our local repository, let's share it with the world by creating a new repository on GitHub.
Go to your GitHub account, and create a new repository.
Once the repository is created, you'll be provided with instructions on how to link your local repository with the remote repository on GitHub.
The instructions will look something like this:
$ git remote add origin https://github.com/yourusername/helloworld.git
$ git push -u origin master
And that's it! Your "Hello, World!" program is now live on GitHub! ๐
Share the link to your repository with your friends and other developers or beginners and the world. Show off your first-ever GitHub repository and let the world know that you're on your way to becoming a C++ pro! ๐ป
Advantages of Creating Repositories on GitHub :
Version control: GitHub allows you to track changes to your code over time, making it easy to collaborate with others and roll back to previous versions of your code if needed.
Collaboration: GitHub makes it easy to collaborate with others on projects by allowing multiple users to work on the same codebase at the same time, and track changes made by each user.
Backup: GitHub provides a secure and reliable backup of your code, so you don't have to worry about losing your work due to a computer crash or other technical issues.
Open-source contributions: GitHub is a popular platform for open-source software development, allowing developers to easily contribute to open-source projects and share their open-source projects with the community.
Showcasing your work: GitHub allows you to create a portfolio of your work and share it with others, which can be useful when looking for a job or seeking to collaborate with other developers.
Learning: GitHub is a great place to find and learn from other developers and their code. Many developers share their work on GitHub, allowing you to learn new skills, techniques and best practices.
Community Support: Having your code on GitHub means you can get support from the open-source community, which can help you to improve your code and overcome bugs, and also you can offer your help and support to others.
Accessibility: GitHub makes it easy for anyone to access your code from anywhere in the world.
Bug tracking: GitHub provides built-in issue-tracking features that allow you to track and manage bugs, feature requests and other tasks related to your code. This makes it easy to keep track of what needs to be done and who is working on it.
Integration: GitHub provides APIs and webhooks that allow you to integrate it with other tools like automated testing, code quality analysis, and deployment tools. This can streamline your development process and make it more efficient.
In short, GitHub is a comprehensive platform that offers a variety of features and tools to benefit developers, whether they are working alone or as part of a team. It offers everything necessary for efficient code management and collaboration, including version control, backup, open-source contributions, showcasing your work, learning, community support, accessibility, code review, continuous integration and deployment, bug tracking and many more features for developers to manage code and collaborate.
Learnings :
As you can see, creating and sharing a GitHub repository is a simple process. With a little bit of practice, you'll be able to create and share your projects with ease. And remember, the more you share your code, the more feedback you'll receive, and the more opportunities you'll have to collaborate with other developers. So don't be shy, and share your work with the world.
Happy coding! ๐๐ป๐
Conclusion :
In conclusion, GitHub is a great platform for developers to share their code and collaborate with others. By creating a repository and sharing your first C++ program, you're on your way to building a portfolio of your work and demonstrating your skills to potential employers or collaborators.
With a little bit of practice, you'll be able to create and share your projects with ease.
Share your code, get feedback, and let the world see your work!
Liked This Blog?
Do react and comment with your thoughts on the points discussed above.
Make sure to follow me :