Sitemap

What is Git?

3 min readNov 24, 2021

--

Git is a popular distributed revision control system created by Linus Torvalds. It is used primarily for source code management in software development, but it can keep track of any files that change over time.

It’s particularly useful because every Git commits or individual changeset within an existing repository stores metadata about the committer, the author/owner of each line in the changed file(s), when the change occurred and what email address they have associated with their account. Individual commits may also contain additional information (comments) about why certain changes were made. Git also tracks changes between different versions on disk; this means it has built-in functionality for creating backups and allows its use as a collaborative tool, as developers may share and update repositories between multiple parties.

Get Odugbayi Daud’s stories in your inbox

Join Medium for free to get updates from this writer.

Git was originally designed to run natively on Linux, but others have ported it over to Microsoft Windows and Mac OS X.

How does it work?

There are two commonly used modes of operation –- ‘single’ and ‘multi’ — which dictate whether the local copy is modifiable. In a single-mode, only one person may modify the repository at a time (and conflicts will occur if changes made by multiple users try to overwrite the same file). Multi-mode allows for simultaneous editing, as long as there is no conflict with any other user’s edits. New files created in multi-mode do not contain Git metadata and must be explicitly added before sharing and synced with others (otherwise, changes won’t be tracked properly). Developers usually use single-mode when initially working on their projects; they can then transition to multi-user or multi-developer mode to allow other contributors to participate actively.

A developer can do everything via Git without ever creating a remote repository. Still, the functionality exists for them to create one and link it with their local copy if they choose. Setting up a remote repository is useful when working on a collaborative project as it allows anyone that has access to push changes back into the master version. The centralized nature of this system means it’s best suited for open-source projects with many developers, rather than personal or private repositories containing only a few different versions of something (like schoolwork). A remote repository contains all metadata about every commit and file change made within it; each local copy references its current status and history of an individual branch –- essentially just the file changes, not the total history of all versions.

Git can be configured to allow users to push code back into a central server after making their local repository copy. This is done by registering a remote with Git using the git-remote command. The most common use for this is with GitHub, which provides free hosting for open-source projects -– you set up your account and then register your working copy as a ‘remote on Github’s servers. It’s now possible to communicate directly with any other user whose repository is also registered on GitHub, meaning you can send them patches or updates whenever you want (subject to permission). They are automatically applied onto the master copy whenever someone pushes back into the repository. Other users can then pull those changes down onto their local computers by referencing that same central server.

https://www.fiverr.com/ferguson189/write-an-ebook-of-30-000-words-quality-ebooks-book-writing?context_referrer=user_page&ref_ctx_id=40bd99b5357a5f4d6974287282dcbdc7&pckg_id=1&pos=1&imp_id=f266b9e9-5f11-4f98-bd88-c710d655309b

--

--