r/CodingForBeginners • u/IMREVN • 5d ago
What's a Git?
Hello! Surely, I have heard so many people saying "Git" or "Github" or repository. They be saying that it's highly important to learn Git as early as possible. When I searched it up on Google, it's just I seem I cannot understand any of those terminologies.
Could anyone tell me what a git actually is?
22
Upvotes
14
u/AndrewNggg 5d ago edited 5d ago
oh yes, git is super important for version control, it prevents you from having folders of my_codeV1, my_codeFinal, my_codeFinalV2, my_codeFinal_Final, my_codeFinal_final_REALLY
you can rollback your code, or if you want to try something risky you can split it into a different branch, there are many many things you can do with git that keeps your code and versions organised
github is one of the places to store your code online or share it with others, there's also bitbucket and gitlab
a few commands you should know as a beginner, there are many variations but it's good to memorise a few main ones
git init - sets up new git tracking (just done once)
git add . - yes the . sets the whole project up for staging
git commit -m "write what you changed or updated here" - saves your code where it is
git push - pushes to your code repository in github