How to Get Started with Git (& this blog)
By criticic
Published on: 25 September 2024
View all posts by criticicYou may be wondering how to get started with Git, and this blog is a great place to start! Here’s how to get started:
-
Go to the GitHub repository for this blog. Fork the repository to your own account by clicking the “Fork” button in the top right corner.
-
Clone your fork of the repository to your local machine, using the following command (if you have SSH set up):
git clone git@github.com:criticic/cops-git-workshop.git
or, if you don’t have SSH set up:
git clone https://github.com/criticic/cops-git-workshop.git
-
Navigate to the repository:
cd cops-git-workshop
-
Create a new branch for your changes:
git checkout -b my-first-branch
-
Make a folder in the
src/content/blogs
directory with your GitHub username (e.g.src/content/blogs/your-username
). -
Create a new Markdown file in that folder with the title of your blog post (e.g.
src/content/blogs/your-username/my-first-blog.md
). -
You can use the following template for your blog post:
--- title: "My First Blog" publishDate: "2024-09-26" --- This is my first blog post! I'm excited to share my thoughts with the world.
Feel free to change the title, content and publish date to whatever you’d like!
-
Add, commit and push your changes:
git add . git commit -m "Add my first blog post" git push origin my-first-branch
-
Create a pull request on Main GitHub Page (not your fork) to merge your changes into the main repository.
-
And wait for your changes to be reviewed and merged!
That’s it! And in ten simple steps, you’ve made your first contribution to this blog using Git. You can share your blogs with your friends and family, and show off your new Git skills. Happy contributing! 🚀
PS: If you have knowledge of Web Development, you can try to contribute to the website as well. If not don’t fret, we will have many more workshops in the future. Stay tuned! 🎉