Git for Beginners: Basics and Essential Commands
What is the Git?
Git is the version control system. Git is the tool that help you track changes in your code. it track every little change or update in your code you make. You can always look back at previous version of your code if needed.
it was created by Linus Torvalds in 2005 for the development of linux kernel .
Feature of Git
Version control system : git track every change in your project file you make. You can go back you can go back on previous code id requirement.
Repositories : git repository is the directory where every thing your project store and mange. There are two main types.
Local Repository : this is the copy of your repository that store in your computer.
Remote Repository : this is store on server, where you and other can share and work on same project.
Commits : Every time you make changes and save them in Git it called as commits. The repository keep track your every commit
Reason to choose Git
Distributed system : Every developer has a complete local copy of the project, allowing work and increase resilience.
Performance : Git is faster and efficient to handling large project.
Branching and Merging : Git’s branching and easy merging facilitate parallel development and featuring isolation.
Terminologies of Git
Repository (Repo) : Where git store the all project files and store their history.
Working directory : Your current working folder that you making changes.
Common Git commands
Setup
- git config —global user.name “[firstname lastname]”
set a name that identifiable for credit when review versoin history
git config —global user.email ‘[valid email]”
set an email address
git config —global color.ui auto
set automatic command line coloring for git easy reviewing
Setup and Init
git init
initialize an existing directory as git repository
Stage and Status
git status
show modified file in working directory, staged for your next commit
git [add]
add a file it looks now to your next commit (stage)
git commit -m “[descriptive message]”
commit your stage content as a new commit snapshot
Comments
Join the discussionNo comments yet. Be the first to comment.