Basic GIT Commands you Need for Hacktoberfest 2022
#hacktoberfest #git #tutorial #beginner #opensource
Table of contents
No headings in the article.
Hacktoberfest has already started!! Have you made any contributions yet??
What is Hacktoberfest ? It is not an Anonymous hacking anniversary, but a global event with the main goal to raise awareness about Open Source and encourage as many developers as possible to participate regularly, not just in October.
For participating in hacktoberfest, knowledge of Git and GitHub is a must. But I think are you facing difficulties with Git CLI commands??
In case you're quite new to git, I will try to explain in a simple way how to use the basic commands you absolutely need to contribute to Open Source.
Disclaimer: This tutorial is meant for beginners. I will oversimplify a little bit to make sure the concepts can be easily understood by someone who might have never used git or has little experience.
No worries you will be able to understand all the commands! Let's deep dive into it.
git config --global user.name “[firstname lastname]” --> set a name that is identifiable for credit when reviewing version history
git config --global user.email “[valid-email]” --> set an email address that will be associated with each history marker
git init --> initialize an existing directory as a Git repository
git clone [url] --> retrieve an entire repository from a hosted location via URL
git status --> show modified files in the working directory, staged for your next commit
git add [file] --> add a file as it looks now to your next commit (stage)
git commit -m “[descriptive message]” --> commit your staged content as a new commit snapshot
git branch --> list your branches. a will appear next to the currently active branch*
git log --> show all commits in the current branch’s history
git rm [file] --> delete the file from project and stage the removal for commit
git merge [alias]/[branch] --> merge a remote branch into your current branch to bring it up to date
Here I have just mentioned some of the commands you need to know to get started with GIT and GitHub.
Technically, you could do some of these steps even without commands in the terminal but with a GUI (Graphical User Interface) such as GitHub Desktop or Sourcetree, however since git is such a widespread and useful tool you're gonna use every day, you must know at least the basics.
If you want to see how these commands can be used in a real case, you can watch this video which I uploaded on my Youtube Channel where I explained complete Git and GitHub from scratch!
Thanks for reading this post, I hope you found it interesting!
Feel free to follow me to get notified when new articles are out :)
Do you like my content? You might consider subscribing to my YouTube channel! You can find it here:
You can follow me on my Socials!! You can find it by clicking the below link :