Git Basics 🔗

Git Basics 🔗

·

3 min read

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency

Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

How to Use Git ? Git is software that you can access via a command line (terminal), or a desktop app that has a GUI (graphical user interface).

Git Repositories : A Git repository (or repo for short) contains all of the project files and the entire revision history. You’ll take an ordinary folder of files (such as a website’s root folder), and tell Git to make it a repository. This creates a .git subfolder, which contains all of the Git metadata for tracking changes.

On Unix-based operating systems such as macOS, files and folders that start with a period (.) are hidden, so you will not see the .git folder in the macOS Finder unless you show hidden files, but it’s there! You might be able to see it in some code editors.

Basic Git commands :

git version : to check the installed git version. git --version git init : The command git init is used to create an empty Git repository. git add : Add command is used after checking the status of the files, to add those files to the staging area. This command used before commit. git add 'NAMEOFFILE ' git commit : The commit command makes sure that the changes are saved to the local repository. The command allows you to describe everyone and help them understand what has happened. "git commit –m " git status :The git status command tells the current state of the repository. git status

What Does a git push Do?**

If you’re working with other people, you need to get your changes to them somehow. Even if you’re working alone, you probably have some remote on GitHub or somewhere similar and need to get your code there, too.

The command you’ll use in all of those scenarios is git push. It helps you push your changes up to a remote repo.

Don’t Push Your Luck With Git: Learn It, and Learn It Well

In Git, you can work 100% locally, but you’ll often want to collaborate with others. Collaborating includes making sure your local repository is in sync with the remote ones. 😊

A good remote management is essential for working effectively with Git, and mastering git push is a vital part of that.

Thank you for taking your valuable time and reading my blog. Feel free to connect on Linkedin 😊 Linkedin

Â