{"id":226825,"date":"2025-05-06T13:44:48","date_gmt":"2025-05-06T13:44:48","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/git-tutorial-simplifying-code-collaboration-and-tracking\/"},"modified":"2025-05-06T13:44:48","modified_gmt":"2025-05-06T13:44:48","slug":"git-tutorial-simplifying-code-collaboration-and-tracking","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=226825","title":{"rendered":"Git Tutorial: Simplifying Code Collaboration and Tracking"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"article-start\">\n<p>In software development, managing code across multiple contributors can get messy fast. Imagine several people editing the same document at the same time, each adding new ideas, fixing bugs, or tweaking features. Without a structured system in place, it\u2019s incredibly difficult to track who changed what, when, and why? Mistakes can be hard to undo, and merging different versions of a project can quickly become chaotic. This is the core problem that Git, and by extension, GitHub aims to solve, giving developers a powerful way to track changes, collaborate efficiently, and manage multiple versions of a codebase without stepping on each other\u2019s toes. This article would serve as a Git tutorial for those struggling with it, and would provide a walkthrough from a beginner\u2019s purview.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-what-is-git\">What is Git?<\/h2>\n<p>Git is a distributed version control system. It is used to monitor code changes, over time. It allows developers to work separately and combine their work without clashes. Git also provides a separate copy of the entire project along with code history, this makes it faster and more reliable. Hence it is suitable for both individual and collaborative projects. Git is mostly command-line based, it provides users with a robust toolbox to branch off features, commit updates, stage changes, and precisely undo errors. It\u2019s crucial to remember that Git is just a tool for managing code; it is completely independent of websites like GitHub and can operate without the internet or any hosting services.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-core-concepts-you-need-to-know\">Core Concepts You Need to Know<\/h2>\n<p>Here\u2019s a quick breakdown of the main ideas behind Git:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Repository (Repo)<\/strong>: A directory where Git tracks your files and changes.<\/li>\n<li><strong>Clone<\/strong>: A copy of a remote repository on your local machine.<\/li>\n<li><strong>Commit<\/strong>: A snapshot of your code at a given moment with a message describing the change.<\/li>\n<li><strong>Branch<\/strong>: A separate version of your codebase to work on new features or fixes.<\/li>\n<li><strong>Merge<\/strong>: Integrating changes from one branch into another.<\/li>\n<li><strong>Push\/Pull<\/strong>: Sending your changes to GitHub or pulling down others\u2019 updates.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-how-to-access-git\">How to Access Git<\/h2>\n<p>Following are the 3 different ways in which you can access Git:<\/p>\n<ol class=\"wp-block-list\">\n<li><strong>Command line<\/strong> \u2013 the most widely used way to access Git.\u00a0<\/li>\n<li><strong>IDEs <\/strong>\u2013 Most popular extensions for Git is <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=eamodio.gitlens\">gitlens<\/a> \u2013 it bring tons of extensions in vs code<\/li>\n<li><strong>GUI for Git <\/strong>\u2013 You can refer to the official website \u2013<a href=\"https:\/\/git-scm.com\/downloads\/guis\"> https:\/\/git-scm.com\/downloads\/guis<\/a>\n<ol class=\"wp-block-list\">\n<li>GitKraken \u2013 Git GUI is one of the popular GUI<\/li>\n<li>SourceTree \u2013 this is available only for windows and mac<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>We will primarily focus on the command line in this article. To Install Git please follow <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2024\/08\/how-to-install-git\/\" target=\"_blank\" rel=\"noreferrer noopener\">this<\/a> guide.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-hands-on\">Hands-on<\/h2>\n<p>Now, that we\u2019ve covered the basics and set up Git on our system, it\u2019s time to get our hands dirty. In this section, we\u2019ll go over some of the most essential Git commands that every developer should know. Whether you\u2019re starting a new project or collaborating on an existing one, these commands form the core workflow of using Git effectively. We\u2019ll keep it simple, practical, and beginner-friendly. No fancy setups, just real commands you\u2019ll actually use. Open your terminal, and let\u2019s dive in!<\/p>\n<p><b>Create a directory<\/b><\/p>\n<pre class=\"wp-block-code\"><code>mkdir git_learning<\/code><\/pre>\n<p><b>Changing directory<\/b><\/p>\n<pre class=\"wp-block-code\"><code>cd git_and_github<\/code><\/pre>\n<p><b>Initialize git\u00a0<\/b><\/p>\n<pre class=\"wp-block-code\"><code>git init<\/code><\/pre>\n<p>This command with initialize the Git repository.\u00a0<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1109\" height=\"318\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_27-1.webp\" alt=\"git init\" class=\"wp-image-233707\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_27-1.webp 1109w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_27-1-300x86.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_27-1-768x220.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_27-1-150x43.webp 150w\" sizes=\"(max-width: 1109px) 100vw, 1109px\"\/><\/figure>\n<\/div>\n<p>You can find a <em>.git<\/em> folder. This is the important folder that is maintained by Git. It gets created when the <code>git init<\/code> command is executed. Git basically uses hashes to store files, it is really memory efficient.<\/p>\n<p>Now let\u2019s create some files.\u00a0<\/p>\n<p><b>Creating a file<\/b><\/p>\n<pre class=\"wp-block-code\"><code>touch file1.txt\u00a0\u00a0<\/code><\/pre>\n<p><b>Editing the file<\/b><\/p>\n<pre class=\"wp-block-code\"><code>vi file1.txt\u00a0<\/code><\/pre>\n<p>Enter <em>i<\/em> to get into insert mode, and add in some text, then, click escape and type <em>:wq<\/em> to save the file.<\/p>\n<p>Do it for the other file as well.\u00a0<\/p>\n<pre class=\"wp-block-code\"><code>touch file2.txt\n\nvi file2.txt<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1507\" height=\"629\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_26.webp\" alt=\"file creation\" class=\"wp-image-233708\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_26.webp 1507w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_26-300x125.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_26-768x321.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_26-150x63.webp 150w\" sizes=\"auto, (max-width: 1507px) 100vw, 1507px\"\/><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"846\" height=\"134\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_25.webp\" alt=\"ls command\" class=\"wp-image-233711\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_25.webp 846w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_25-300x48.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_25-768x122.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_25-150x24.webp 150w\" sizes=\"auto, (max-width: 846px) 100vw, 846px\"\/><\/figure>\n<\/div>\n<p>To know the status of the repository<\/p>\n<pre class=\"wp-block-code\"><code>git status<\/code><\/pre>\n<p>This command will show the changes made in the directory and whether they are tracked or not.\u00a0<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"847\" height=\"249\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_24.webp\" alt=\"git status\" class=\"wp-image-233712\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_24.webp 847w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_24-300x88.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_24-768x226.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_24-150x44.webp 150w\" sizes=\"auto, (max-width: 847px) 100vw, 847px\"\/><\/figure>\n<\/div>\n<p><b>For a short status you can use<\/b><\/p>\n<pre class=\"wp-block-code\"><code>git status -s\u00a0<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-staging-area-in-git-nbsp\">Staging area in Git\u00a0<\/h3>\n<p>Before making a commit in Git we have something called staging area. Where we will see the changes made and would review them before making a commit. This is a special feature in Git. We can review the changes between the previous commit and the staged changes and then make a new commit.\u00a0<\/p>\n<p><b>To stage the changes done in our directory we will use<\/b><\/p>\n<pre class=\"wp-block-code\"><code>git add\u00a0\n\ngit add file1.txt file2.txt<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"991\" height=\"246\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_23.webp\" alt=\"git status\" class=\"wp-image-233713\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_23.webp 991w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_23-300x74.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_23-768x191.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_23-150x37.webp 150w\" sizes=\"auto, (max-width: 991px) 100vw, 991px\"\/><\/figure>\n<\/div>\n<p>This will start tracking the changes made in the directory.\u00a0\u00a0<\/p>\n<p>Now, to add all the files in the directory to staging, you can simply use:<\/p>\n<pre class=\"wp-block-code\"><code>git add .<\/code><\/pre>\n<p>be cautious when using this command. This is because it would track everything in your directory like logs, environment files, datasets, etc. This might overload Git and cause inefficient version management.\u00a0<\/p>\n<p>Each commit has a:<\/p>\n<ol class=\"wp-block-list\">\n<li><strong>ID<\/strong> \u2013 Unique identifier (a hashvalue).<\/li>\n<li><strong>Message<\/strong> \u2013 Description of what changes have been done.<\/li>\n<li><strong>Date\/Time<\/strong> \u2013 when was it changed.<\/li>\n<li><strong>Author<\/strong> \u2013 Who has changed the files.<\/li>\n<li><strong>Complete snapshot<\/strong> \u2013 at the time of commit.<\/li>\n<\/ol>\n<p>You may think that saving the entire snapshot every time in commit will make use of memory which is very inefficient. But Git does not store duplicate content and compresses the contents in order to reduce memory space. So, it might be a viable strategy after all!<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-committing-changes\"><b>Committing Changes<\/b><\/h3>\n<pre class=\"wp-block-code\"><code>git commit -m \u201cShort description\u201d<\/code><\/pre>\n<p><code>-m<\/code> is for message.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"991\" height=\"115\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_22.webp\" alt=\"git commit\" class=\"wp-image-233714\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_22.webp 991w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_22-300x35.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_22-768x89.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_22-150x17.webp 150w\" sizes=\"auto, (max-width: 991px) 100vw, 991px\"\/><\/figure>\n<\/div>\n<p>But sometimes, we\u2019ll not be happy with a short description. We would have to provide more context on the changes done.<\/p>\n<p>To do that we will just use:<\/p>\n<pre class=\"wp-block-code\"><code>git commit\u00a0<\/code><\/pre>\n<p>This will open a file in our editor, where we can type a description which is less than 80 characters (don\u2019t forget to add a line break after the description). To achieve this, let\u2019s make some changes for a new commit. Let me add another empty file and commit the changes.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1507\" height=\"629\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_21.webp\" alt=\"Editor\" class=\"wp-image-233716\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_21.webp 1507w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_21-300x125.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_21-768x321.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_21-150x63.webp 150w\" sizes=\"auto, (max-width: 1507px) 100vw, 1507px\"\/><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"871\" height=\"291\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_20.webp\" alt=\"git commit\" class=\"wp-image-233717\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_20.webp 871w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_20-300x100.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_20-768x257.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_20-150x50.webp 150w\" sizes=\"auto, (max-width: 871px) 100vw, 871px\"\/><\/figure>\n<\/div>\n<p>One misconception is \u201cwhen we commit the staging; the staging area becomes empty!.\u201d This is incorrect. The staging area does not become empty instead there is no difference between staging area and previous commit.<\/p>\n<p><b>Guidelines<\/b>:<\/p>\n<ol class=\"wp-block-list\">\n<li>Commits should not be too big or too small. We don\u2019t have to commit on small changes for each file. Also, we don\u2019t have to commit only after a lot of changes are made.\u00a0As you reach a state where you want to record then make a commit.<\/li>\n<li>If you have a typo and a bug resolved meaning: you found a typo while resolving a bug; both should not be committed at the same time as when reverting a typo, the bug will be reverted as well. Hence we have to do it separately. Also, if you have staged both together we can unstage them separately as well.\u00a0<\/li>\n<li>Commit messages should be meaningful. Since, Git is used for collaboration as well (not just for version control) giving meaningful commit messages and following nomenclatures would help everyone in the project understand the changes made.\u00a0<\/li>\n<\/ol>\n<h3 class=\"wp-block-heading\" id=\"h-committing-without-staging\">Committing without staging<\/h3>\n<p>Can we commit changes without adding them to the staging area i.e., before <code>git add<\/code> command?<\/p>\n<p>Yes! we can. Let\u2019s look at an example. Let me make a change in <em>file3.txt<\/em>.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1001\" height=\"409\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_19.webp\" alt=\"File creation\" class=\"wp-image-233718\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_19.webp 1001w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_19-300x123.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_19-768x314.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_19-150x61.webp 150w\" sizes=\"auto, (max-width: 1001px) 100vw, 1001px\"\/><\/figure>\n<\/div>\n<pre class=\"wp-block-code\"><code>git commit -am \u201cmessage\u201d\u00a0<\/code><\/pre>\n<p><code>-a<\/code> tells Git to automatically stage any files that have been modified and already tracked.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1214\" height=\"340\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_18.webp\" alt=\"Checking status\" class=\"wp-image-233719\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_18.webp 1214w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_18-300x84.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_18-768x215.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_18-150x42.webp 150w\" sizes=\"auto, (max-width: 1214px) 100vw, 1214px\"\/><\/figure>\n<\/div>\n<p>Let\u2019s say you have staged your entire repository, but you would want to remove a file. Usually, you will use the <code>rm<\/code> command to remove the file. But that file will still be in the staging area, so to remove that as well we will be doing below steps.\u00a0<\/p>\n<p>One possible way is to use a normal <code>rm<\/code> command and then <code>git add <deleted_filename> <\/deleted_filename><\/code>to remove that from starting area. I know it sounds weird but <code>git add<\/code> here will remove the file from the staging area.\u00a0<\/p>\n<ol class=\"wp-block-list\">\n<li\/>\n<\/ol>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"873\" height=\"396\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_17.webp\" alt=\"git add\" class=\"wp-image-233720\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_17.webp 873w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_17-300x136.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_17-768x348.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_17-150x68.webp 150w\" sizes=\"auto, (max-width: 873px) 100vw, 873px\"\/><\/figure>\n<\/div>\n<p>Since here <em>file3.txt<\/em> is being tracked it shows <em>file3.txt<\/em> is deleted.\u00a0\u00a0<\/p>\n<p>In case there is a file which was staged already and you would want to remove it, follow this:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"862\" height=\"650\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_16.webp\" alt=\"git rm\" class=\"wp-image-233722\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_16.webp 862w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_16-300x226.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_16-768x579.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_16-150x113.webp 150w\" sizes=\"auto, (max-width: 862px) 100vw, 862px\"\/><\/figure>\n<\/div>\n<p>Let\u2019s try using <code>git rm <file_name\/><\/code> without using the traditional <code>rm<\/code> command.\u00a0<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"898\" height=\"562\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_15.webp\" alt=\"git rm\" class=\"wp-image-233723\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_15.webp 898w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_15-300x188.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_15-768x481.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_15-150x94.webp 150w\" sizes=\"auto, (max-width: 898px) 100vw, 898px\"\/><\/figure>\n<\/div>\n<p>We can see from <code>git status<\/code> that the new file is present. Later, after using <code>git rm<\/code> command we can see that the new file is not present. The <code>git rm<\/code> command deletes the file from the staging area and the working directory whereas the <code>rm<\/code> command (linux) only deletes the file form your working directory. <\/p>\n<h3 class=\"wp-block-heading\" id=\"h-how-to-ignore-some-files-from-being-tracked\">How to ignore some files from being tracked<\/h3>\n<p>Let\u2019s see how to ignore tracking of some files. But that begs the question: why would you want to not tract files. Here\u2019s why, Suppose you have log files: you generate hefty amount of log files, dataset, this will be updated each time a change is made to them. There basically JSON representation yet running notebooks may yield different outputs each time making hard for Git to track changes. Hence use .<em>gitignore<\/em> to avoid Git from tracking these files.\u00a0\u00a0<\/p>\n<p>We will always have to ignore some files from tracking, like log files. Adding these files to the repository will just increase the size of the repository. Therefore, we have to ignore these files in Git.\u00a0In the following image, I am creating a <em>logs<\/em> directory and a <em>logs<\/em> file. Later, a <em>.gitignore<\/em> file was created and then a <em>logs<\/em> directory entry was added into the <em>.gitignore<\/em> file. This will stop Git from tracking the specified files.\u00a0<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1038\" height=\"499\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_14.webp\" alt=\"Ignoring Files\" class=\"wp-image-233724\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_14.webp 1038w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_14-300x144.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_14-768x369.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_14-150x72.webp 150w\" sizes=\"auto, (max-width: 1038px) 100vw, 1038px\"\/><\/figure>\n<\/div>\n<p>We can see that the logs folder is not tracked anymore.\u00a0\u00a0<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-handling-the-outliers\">Handling the outliers<\/h3>\n<p>There is one problem! When we start tracking a file using git <code>add<\/code> or <code>commit<\/code>,  and then add that to <em>gitignore<\/em>, Git will still track changes made in that file or directory. So to avoid that we have to remove the files\/directories from staging area. But <code>git rm<\/code> will remove the files in both staging and directory. Therefore, If we want to remove it only from staging, we will be using\u00a0:<\/p>\n<pre class=\"wp-block-code\"><code>git rm -r\u00a0 \u2013 cached directory_name\/filename<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"191\" height=\"300\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_13.webp\" alt=\"Logs\" class=\"wp-image-233725\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_13.webp 191w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_13-150x236.webp 150w\" sizes=\"auto, (max-width: 191px) 100vw, 191px\"\/><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"511\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_11.webp\" alt=\"Status\" class=\"wp-image-233727\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_11.webp 826w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_11-300x186.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_11-768x475.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_11-150x93.webp 150w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\"\/><\/figure>\n<\/div>\n<p>You can see that the file <em>not_track.txt<\/em> is tracked. So to avoid this from happening, we have to use the following command:<\/p>\n<pre class=\"wp-block-code\"><code>git rm -r \u2013cached directory_name\/filename<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1039\" height=\"195\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_10.webp\" alt=\"Cached attribute\" class=\"wp-image-233730\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_10.webp 1039w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_10-300x56.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_10-768x144.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_10-150x28.webp 150w\" sizes=\"auto, (max-width: 1039px) 100vw, 1039px\"\/><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-seeing-the-difference\">Seeing the difference<\/h3>\n<p>Now, let\u2019s see what changes have been made between the last commit and the staged files.\u00a0<\/p>\n<p>We will using the below command to do it:<\/p>\n<pre class=\"wp-block-code\"><code>git diff --staged<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"361\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_9.webp\" alt=\"Staged attribute\" class=\"wp-image-233731\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_9.webp 868w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_9-300x125.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_9-768x319.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_9-150x62.webp 150w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\"\/><\/figure>\n<\/div>\n<p>Following is the explanation of the above screenshot:\u00a0<\/p>\n<p><em>.gitignore<\/em> didn\u2019t exist before (<em>\/dev\/null<\/em> means no previous file).<\/p>\n<p>Two entries were added:<\/p>\n<ul class=\"wp-block-list\">\n<li><em>logs\/<\/em> \u2192 Ignores the directory.<\/li>\n<li><em>not_track.txt <\/em>\u2192 Ignores the file.<\/li>\n<\/ul>\n<p><em>file3.txt<\/em> is being removed from the repo (staged for deletion). The file had one line: \u201cThis is my third file\u201d.<\/p>\n<p>Usually developers use GUI tools to see the <code>diff<\/code> like <a href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">VS Code<\/a> \u2013 but it is also possible to visualize the difference using the command line.\u00a0<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-git-diff-comes-to-the-rescue\">git diff comes to the rescue<\/h3>\n<p>What <code>git diff <\/code>does is, it will compare the files between the last commit and the staged ones . Ex. <em>a\/file1.js <\/em>is the old file and <em>b\/file1.j<\/em>s is the new file \u2192 changes in the old copy is indicated by <code>-<\/code> (minus) sign in red and changes in the new copy are indicated by <code>+<\/code> (plus) in green (can be seen in the image).<\/p>\n<pre class=\"wp-block-preformatted\">Green - newly appended lines<p>Red - these lines will be removed<\/p><p>White - These lines are there in the old and new code.<\/p><\/pre>\n<p><code>git diff<\/code> command shows the difference between directory and staging.<\/p>\n<p>Let\u2019s make some changes in the directory to use this command:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"361\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_8.webp\" alt=\"File creation\" class=\"wp-image-233734\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_8.webp 868w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_8-300x125.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_8-768x319.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_8-150x62.webp 150w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\"\/><\/figure>\n<\/div>\n<p>Now, let\u2019s stage all the files, and commit our changes to look at all the commits that are made in the past. To view this use:<\/p>\n<pre class=\"wp-block-code\"><code>git log<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"226\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_7.webp\" alt=\"git diff\" class=\"wp-image-233735\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_7.webp 814w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_7-300x83.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_7-768x213.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_7-150x42.webp 150w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\"\/><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1236\" height=\"359\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_6.webp\" alt=\"git commit\" class=\"wp-image-233736\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_6.webp 1236w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_6-300x87.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_6-768x223.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_6-150x44.webp 150w\" sizes=\"auto, (max-width: 1236px) 100vw, 1236px\"\/><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"539\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_5.webp\" alt=\"Git log\" class=\"wp-image-233737\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_5.webp 755w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_5-300x214.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_5-150x107.webp 150w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\"\/><\/figure>\n<\/div>\n<p><code>git log \u2014oneline<\/code> \u2192 this gives us a brief summary of commits.<\/p>\n<p><code>git log \u2014oneline \u2014reverse<\/code> \u2192 this will reverse the order of commits.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"987\" height=\"230\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_4.webp\" alt=\"log attributes\" class=\"wp-image-233738\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_4.webp 987w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_4-300x70.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_4-768x179.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_4-150x35.webp 150w\" sizes=\"auto, (max-width: 987px) 100vw, 987px\"\/><\/figure>\n<\/div>\n<p><b>To see the changes in a commit we can use<\/b><\/p>\n<pre class=\"wp-block-code\"><code>git show <id of=\"\" that=\"\" commit=\"\"\/><\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"987\" height=\"294\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_3.webp\" alt=\"git show\" class=\"wp-image-233739\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_3.webp 987w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_3-300x89.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_3-768x229.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_3-150x45.webp 150w\" sizes=\"auto, (max-width: 987px) 100vw, 987px\"\/><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-how-to-get-the-previous-commit-s-changes\">How to get the previous commit\u2019s changes<\/h3>\n<p><code>git restore --staged filename<\/code> \u2192 this will take the file from the previous commit and put it here.\u00a0<\/p>\n<p><code>git restore .<\/code> will take files from staging environment and put it in the working directory. But if there is a new untracked file which is not present in previous commits, it will stay as it is.\u00a0\u00a0<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"917\" height=\"319\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_2.webp\" alt=\"File creation\" class=\"wp-image-233740\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_2.webp 917w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_2-300x104.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_2-768x267.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_2-150x52.webp 150w\" sizes=\"auto, (max-width: 917px) 100vw, 917px\"\/><\/figure>\n<\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"913\" height=\"629\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_1.webp\" alt=\"Git restore\" class=\"wp-image-233741\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_1.webp 913w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_1-300x207.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_1-768x529.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/05\/image_1-150x103.webp 150w\" sizes=\"auto, (max-width: 913px) 100vw, 913px\"\/><\/figure>\n<\/div>\n<p>We can see that the changes made in <em>file1.txt<\/em> after running the command <code>git restore<\/code>, have been reverted to their previous commit state.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-recap\"><b>Recap<\/b><\/h3>\n<p>In this hands-on session, we walked through the foundational Git commands used in real-world development workflows. We began by setting up a Git repository and learned how to create and edit files. Key concepts such as the working directory, staging area, and commits were introduced along with commands like <code>git init<\/code>, <code>git add<\/code>, <code>git commit<\/code>, and <code>git status<\/code>. We explored how Git tracks changes, manages file versions, and handles staged vs unstaged files. Special emphasis was given to proper commit practices, the use of .<em>gitignore<\/em> to avoid tracking unnecessary files, and viewing differences with git diff. Finally, we looked at ways to inspect previous commits and recover changes using <code>git log<\/code>, <code>git show<\/code>, and <code>git restore<\/code>.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n<p>Git might seem overwhelming at first, but once you grasp the core concepts like staging, committing, restoring, and viewing history, it becomes a powerful tool in your workflow. In this article, we focused on the command line because it gives you the most control and transparency over what\u2019s happening behind the scenes. Understanding how Git tracks files, handles commits, and manages changes lets you write cleaner code, collaborate more effectively, and recover quickly when things go wrong. Whether you\u2019re rolling back a bad change, exploring commit history, or just organizing your work, Git has got your back.<\/p>\n<div class=\"border-top py-3 author-info my-4\">\n<div class=\"author-card d-flex align-items-center\">\n<div class=\"flex-shrink-0 overflow-hidden\">\n                                    <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/author\/badrinarayan6645541\/\" class=\"text-decoration-none active-avatar\"><br \/>\n                                                                       <img decoding=\"async\" src=\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_00OeVxR.webp\" width=\"48\" height=\"48\" alt=\"Badrinarayan M\" loading=\"lazy\" class=\"rounded-circle\"\/><\/p>\n<p>                                <\/a>\n                                <\/div>\n<\/p><\/div>\n<p>Data science Trainee at Analytics Vidhya, specializing in ML, DL and Gen AI. Dedicated to sharing insights through articles on these subjects. Eager to learn and contribute to the field&#8217;s advancements. Passionate about leveraging data to solve complex problems and drive innovation.<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><h4 class=\"fs-24 text-dark\">Login to continue reading and enjoy expert-curated content.<\/h4>\n<p>                        <button class=\"btn btn-primary mx-auto d-table\" data-bs-toggle=\"modal\" data-bs-target=\"#loginModal\" id=\"readMoreBtn\">Keep Reading for Free<\/button>\n                    <\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>In software development, managing code across multiple contributors can get messy fast. Imagine several people editing the same document at the same time, each adding new ideas, fixing bugs, or tweaking features. Without a structured system in place, it\u2019s incredibly difficult to track who changed what, when, and why? Mistakes can be hard to undo, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":226826,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[11230,13035,72031,29260,1706,13955],"dealstore":[],"offerexpiration":[],"class_list":["post-226825","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-code","tag-collaboration","tag-git","tag-simplifying","tag-tracking","tag-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git Tutorial: Simplifying Code Collaboration and Tracking - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=226825\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Tutorial: Simplifying Code Collaboration and Tracking - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"In software development, managing code across multiple contributors can get messy fast. Imagine several people editing the same document at the same time, each adding new ideas, fixing bugs, or tweaking features. Without a structured system in place, it\u2019s incredibly difficult to track who changed what, when, and why? Mistakes can be hard to undo, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=226825\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-06T13:44:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/Beginners-guide-to-Git.webp.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"872\" \/>\n\t<meta property=\"og:image:height\" content=\"473\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=226825#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=226825\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Git Tutorial: Simplifying Code Collaboration and Tracking\",\"datePublished\":\"2025-05-06T13:44:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=226825\"},\"wordCount\":2197,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=226825#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/Beginners-guide-to-Git.webp.webp\",\"keywords\":[\"Code\",\"collaboration\",\"Git\",\"Simplifying\",\"Tracking\",\"Tutorial\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=226825#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=226825\",\"url\":\"https:\/\/fivemor.com\/?p=226825\",\"name\":\"Git Tutorial: Simplifying Code Collaboration and Tracking - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=226825#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=226825#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/Beginners-guide-to-Git.webp.webp\",\"datePublished\":\"2025-05-06T13:44:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=226825#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=226825\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=226825#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/Beginners-guide-to-Git.webp.webp\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/Beginners-guide-to-Git.webp.webp\",\"width\":872,\"height\":473},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=226825#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git Tutorial: Simplifying Code Collaboration and Tracking\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git Tutorial: Simplifying Code Collaboration and Tracking - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=226825","og_locale":"en_US","og_type":"article","og_title":"Git Tutorial: Simplifying Code Collaboration and Tracking - Som2ny Network","og_description":"In software development, managing code across multiple contributors can get messy fast. Imagine several people editing the same document at the same time, each adding new ideas, fixing bugs, or tweaking features. Without a structured system in place, it\u2019s incredibly difficult to track who changed what, when, and why? Mistakes can be hard to undo, [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=226825","og_site_name":"Som2ny Network","article_published_time":"2025-05-06T13:44:48+00:00","og_image":[{"width":872,"height":473,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/Beginners-guide-to-Git.webp.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=226825#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=226825"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Git Tutorial: Simplifying Code Collaboration and Tracking","datePublished":"2025-05-06T13:44:48+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=226825"},"wordCount":2197,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=226825#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/Beginners-guide-to-Git.webp.webp","keywords":["Code","collaboration","Git","Simplifying","Tracking","Tutorial"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=226825#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=226825","url":"https:\/\/fivemor.com\/?p=226825","name":"Git Tutorial: Simplifying Code Collaboration and Tracking - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=226825#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=226825#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/Beginners-guide-to-Git.webp.webp","datePublished":"2025-05-06T13:44:48+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=226825#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=226825"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=226825#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/Beginners-guide-to-Git.webp.webp","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/05\/Beginners-guide-to-Git.webp.webp","width":872,"height":473},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=226825#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Git Tutorial: Simplifying Code Collaboration and Tracking"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/226825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=226825"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/226825\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/226826"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=226825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=226825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=226825"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=226825"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=226825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}