Play this article
What is Git?
Git is a modern and widely-used distributed version control system in the world. It is developed to manage projects with high speed and efficiency. The version control system allows us to monitor and work together with our team members in the same workspace.
It is a Version Control System for tracking changes in computer files and coordinating work on those files among multiple people.
It is primarily used for source code management in software development, But it can be used to keep track of changes in any set of files.
Why Git?
- Open Source
- Scalable
- Distributed
- Security
- Speed
- Branching
Most Commonly used git commands
1. Initializing Git
git init
2. Adding files to Git
To add all files to git
git add .
git add *
To add a specific file
git add filename.extension
3. Status of git repository
git status
All files in that directory are tracked
If some of the files are not tracked
4. Getting help
git help
5. Committing changes to the git repository
git commit -m "Initial commit"
6. Adding a remote repository
git remote add origin https://github.com/username/reponame.git
7. Pushing the code to the remote repository
git push -u origin master
Did you find this article valuable?
Support Prahlad Inala by becoming a sponsor. Any amount is appreciated!