Git

From WikiMD's Wellness Encyclopedia

Git-logo-2012

Git is a 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.

History[edit | edit source]

Git was created by Linus Torvalds in 2005 for development of the Linux kernel, with other kernel developers contributing to its initial development. Its development was motivated by the need for a distributed system that could be used offline, provide faster operations, and improve security and flexibility when compared to the systems available at the time, such as BitKeeper and CVS.

Design[edit | edit source]

The design of Git is a departure from the centralized version control model. Instead, it is based on a distributed model, where every developer's working copy of the code is also a repository that can contain the full history of all changes. This decentralized approach facilitates various workflows, whether they be solo development, team collaboration, or hierarchical team structures, making Git a versatile tool for developers.

Features[edit | edit source]

- Branching and Merging: Git allows and encourages branching and merging, with simple and powerful tools to manage branches. This encourages experimenting and diverging from the main line of development, and provides the ability to merge changes back into the main branch or discard them with ease. - Speed: Git is designed for speed. Committing new changes, branching, merging, and comparing past versions are all optimized for performance. - Data Integrity: Git ensures the integrity of version history by using a cryptographic hash function (SHA-1) to identify and manage files and directories. - Staging Area: Git has an intermediate stage called the "staging area" or "index", where commits can be formatted and reviewed before completing the commit. - Distributed Development: With Git, every developer has their own local repository, complete with a full history of commits. This not only makes working offline possible but also makes a wide variety of workflows and policies possible.

Usage[edit | edit source]

Git is used for source code management in software development and other version control tasks. It is designed to handle a small to very large projects with speed and efficiency. Git is used by both individual developers and large teams, where it serves as the backbone for many popular web services, open-source projects, and commercial applications.

Installation and Setup[edit | edit source]

Git can be installed on Linux, macOS, and Windows. Installation methods vary depending on the operating system, but once installed, setting up Git requires configuring user information used across all local repositories. This setup includes setting up the user name and email address, which are important for commit messages.

Basic Commands[edit | edit source]

- git init: Initializes a new Git repository. - git clone: Clones a repository into a new directory. - git add: Adds file contents to the index. - git commit: Records changes to the repository. - git status: Shows the working tree status. - git push: Updates remote refs along with associated objects. - git pull: Fetches from and integrates with another repository or a local branch. - git branch: Lists, creates, or deletes branches. - git merge: Joins two or more development histories together.

See Also[edit | edit source]

- Version control - Software development - GitHub - Bitbucket - GitLab

WikiMD
Navigation: Wellness - Encyclopedia - Health topics - Disease Index‏‎ - Drugs - World Directory - Gray's Anatomy - Keto diet - Recipes

Search WikiMD

Ad.Tired of being Overweight? Try W8MD's physician weight loss program.
Semaglutide (Ozempic / Wegovy and Tirzepatide (Mounjaro / Zepbound) available.
Advertise on WikiMD

WikiMD's Wellness Encyclopedia

Let Food Be Thy Medicine
Medicine Thy Food - Hippocrates

Medical Disclaimer: WikiMD is not a substitute for professional medical advice. The information on WikiMD is provided as an information resource only, may be incorrect, outdated or misleading, and is not to be used or relied on for any diagnostic or treatment purposes. Please consult your health care provider before making any healthcare decisions or for guidance about a specific medical condition. WikiMD expressly disclaims responsibility, and shall have no liability, for any damages, loss, injury, or liability whatsoever suffered as a result of your reliance on the information contained in this site. By visiting this site you agree to the foregoing terms and conditions, which may from time to time be changed or supplemented by WikiMD. If you do not agree to the foregoing terms and conditions, you should not enter or use this site. See full disclaimer.
Credits:Most images are courtesy of Wikimedia commons, and templates Wikipedia, licensed under CC BY SA or similar.

Contributors: Prab R. Tumpati, MD