DevOPs Git Commands by Editorial Staff February 25, 2023 written by Editorial Staff February 25, 2023 Git is a distributed version control system that helps developers collaborate on projects of anyscale.Linus Torvalds, the developer of the Linux kernel, created Git in 2005 to help control the Linuxkernel’s development. What is a Distributed Version Control System? A distributed version control system is a system that helps you keep track of changes you’vemade to files in your project.This change history lives on your local machine and lets you revert to a previous version of yourproject with ease in case something goes wrong.Git makes collaboration easy. Everyone on the team can keep a full backup of the repositoriesthey’re working on on their local machine. Then, thanks to an external server like Bit Bucket,GitHub or GitLab, they can safely store the repository in a single place.This way, different members of the team can copy it locally and everyone has a clear overviewof all changes made by the whole team.Git has many different commands you can use. And I’ve found that these fifty are the ones I usethe most often (and are therefore the most helpful to remember). Getting Started – Installing Git Installing Git Before you start using Git, you have to make it available on your computer. Even if it’s alreadyinstalled, it’s probably a good idea to update to the latest version. You can either install it as apackage or via another installer, or download the source code and compile it yourself. Note: This document was written using Git version 2. Since Git is quite excellent at preservingbackwards compatibility, any recent version should work just fine. Though most of thecommands we use should work even in ancient versions of Git, some of them might notor might act slightly differently. Installing on Linux If you want to install the basic Git tools on Linux via a binary installer, you can generallydo so through the package management tool that comes with your distribution. If you’re on Fedora (or any closely-related RPM-based distribution, such as RHEL or CentOS), you can use dnf: $ sudo dnf install git-all If you’re on a Debian-based distribution, such as Ubuntu, try apt: $ sudo apt install git-all Some times you will face this type of issues while installing git on linux Platforms. root@vmlinux:~# sudo apt install git-all Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package git-all Try this and then install root@vmlinux:~# sudo apt update Hit:1 http://azure.archive.ubuntu.com/ubuntu bionic InRelease Get:2 http://azure.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:3 http://azure.archive.ubuntu.com/ubuntu bionic-backports InRelease [83.3 kB] Get:4 http://azure.archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] .. Get:20 http://azure.archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1232 kB] Get:21 http://azure.archive.ubuntu.com/ubuntu bionic-security/universe Translation-en [283 kB] ..-security/multiverse Translation-en [3836 B] Fetched 23.5 MB in 5s (4639 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 1 package can be upgraded. Run 'apt list --upgradable' to see it. root@vmlinux:~# sudo apt install git-all Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: linux-headers-4.15.0-193 .. libtypes-serialiser-perl liburi-perl libvariable-magic-perl libwayland- client0 libwayland-cursor0 libwayland-egl1 libwebp6 libwww-perl libwww-robotrules-perl libx11-xcb1 libxaw7 libxcb- dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxft2 libxi6 libxinerama1 libxkbcommon0 libxmu6 libxpm4 libxrandr2 libxrender1 libxshmfence1 libxss1 libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1 libyaml-libyaml-perl libyaml-perl m17n-db perl-openssl-defaults poppler-data runit ssl-cert tcl tcl8.6 tk tk8.6 ubuntu-mono x11-common x11- utils xbitmaps xterm 0 upgraded, 275 newly installed, 0 to remove and 1 not upgraded. Need to get 108 MB of archives. After this operation, 657 MB of additional disk space will be used. Do you want to continue? [Y/n] C Continue with Y .... Setting up libsoup-gnome2.4-1:amd64 (2.62.1-1ubuntu0.4) ... Setting up librest-0.7-0:amd64 (0.8.0-2) ... Setting up libgtk-3-0:amd64 (3.22.30-1ubuntu4) ... Setting up libgtk-3-bin (3.22.30-1ubuntu4) ... Setting up emacs25 (25.2+1-6) ... update-alternatives: using /usr/bin/emacs25-x to provide /usr/bin/emacs (emacs) in auto mode Install emacsen-common for emacs25 emacsen-common: Handling install of emacsen flavor emacs25 Install git for emacs25 install/git: Handling install of emacsen flavor emacs25 install/git: Byte-compiling for emacs25 + emacs25 -batch -q -no-site-file -f batch-byte-compile git.el git-blame.el Setting up emacs (47.0) ... Setting up git-el (1:2.17.1-1ubuntu0.12) ... Install git for emacs Install git for emacs25 install/git: Handling install of emacsen flavor emacs25 install/git: Byte-compiling for emacs25 + emacs25 -batch -q -no-site-file -f batch-byte-compile git.el git-blame.el Setting up git-all (1:2.17.1-1ubuntu0.12) ... Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.36.11-2) ... Processing triggers for libc-bin (2.27-3ubuntu1.6) ... Its completed, you verify with below commands root@vmlinux:~# git version git version 2.17.1 root@vmlinux:~# git --version git version 2.17.1 root@vmlinux:~# For more options, there are instructions for installing on several different Unix distributions onthe Git website, at https://git-scm.com/download/linux. 0 comment 0 FacebookTwitterPinterestEmail Editorial Staff previous post Linux Basics next post Git Commands You may also like Git Commands February 26, 2023 Git Commands February 26, 2023 Git Commands February 26, 2023 DevOps December 19, 2022 Leave a Comment Cancel Reply Save my name, email, and website in this browser for the next time I comment.