{"id":27887425,"url":"https://github.com/vantamnguyen/git-concepts","last_synced_at":"2025-10-14T10:18:43.969Z","repository":{"id":280683040,"uuid":"123459033","full_name":"VanTamNguyen/Git-Concepts","owner":"VanTamNguyen","description":"All about Git. Git concepts. Cit commands...","archived":false,"fork":false,"pushed_at":"2021-09-15T03:12:17.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T08:02:46.719Z","etag":null,"topics":["cit-commands","git","git-concepts","version-control-system"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VanTamNguyen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-01T16:10:08.000Z","updated_at":"2021-09-15T03:12:19.000Z","dependencies_parsed_at":"2025-03-04T20:00:20.574Z","dependency_job_id":null,"html_url":"https://github.com/VanTamNguyen/Git-Concepts","commit_stats":null,"previous_names":["vantamnguyen/git-concepts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/VanTamNguyen/Git-Concepts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VanTamNguyen%2FGit-Concepts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VanTamNguyen%2FGit-Concepts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VanTamNguyen%2FGit-Concepts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VanTamNguyen%2FGit-Concepts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VanTamNguyen","download_url":"https://codeload.github.com/VanTamNguyen/Git-Concepts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VanTamNguyen%2FGit-Concepts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018775,"owners_count":26086450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cit-commands","git","git-concepts","version-control-system"],"created_at":"2025-05-05T08:03:19.394Z","updated_at":"2025-10-14T10:18:43.940Z","avatar_url":"https://github.com/VanTamNguyen.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git-Concepts\nAll about Git. Git concepts. Git commands...\n\n\n#### 1. Basic Concepts\n* **Local repository** is a private workplace as *working copy* for developer to make changes. And after commit, these changes become part of remote repository (permanent stored on server).\n\n* **Working directory and Staging area or Index**\n\u003cp align=\"center\"\u003e\u003cimg src=\"images/flow.png\"/\u003e\u003c/p\u003e\n\n* **Blob** stands for Binary Large Object. Each version of a file is reprensted by blob. Blob holds the file data but does not contain any metadata about the file. It is a binary file, and in Git databases, it is named as the SHA1 hash of that file. In Git, files are not addressed by names. Everything is content-addressed.\n\n* **Tree** is an object, which represents a directory. It holds blobs as well as sub-directories. A tree is a binary file which stores references to to blobs and sub-trees.\n\n* **Commit** holds the current state of the repository. Commit also is named by the SHA1 hash. A commit object is a node in linked list. Each commit has a pointer points to the parent commit so that we can view the history of the repository. If a commit has multiple parent commit, then that commit has been created by merging two branches.\n\n* **Branch** is a line of development. By default, Git has the master branch. Usually, branch is used to develop a new feature. Once the feature is done, the branch is merged back to the master branch. Every branch is referenced by HEAD, which point to the latest commit in branch.\n\n* **Tag** assigns a meaningful name with a specific version in the repository. Usually, developers create tags for product releases.\n\n* **Clone** get remote repository into the local one.\n\n* **Pull** operation will copy changes from remote repository instance to the local one. The pull operation is used to synchronize between two repository instances.\n\n* **Push** operation will copy changes from local repository instance to a remote one. The push operation will store changes permanently on remote repository.\n\n* **HEAD** is a pointer that point to the latest commit in a branch. Whenever we make a commit HEAD will be updated. The heads of the branches are stored in .git/refs/heads/ directory.\n    ```\n    [ubuntu]$ ls .git/refs/heads/\n    master\n    develop\n    feature\n    \n    [ubuntu]$ cat .git/refs/heads/master\n    570837e7d58fa4bccd86cb575d884502188b0c49\n    ```\n\n\n* **Revision** represents the version of the source code. Revision is represented by commit. Commit is identified by SHA1 hash.\n\n\n#### 2. Merging vs. Rebasing\n* **Merging**\u003cbr/\u003e\u003cbr/\u003e![merging](images/merge.png)\n* **Rebasing**\u003cbr/\u003e\u003cbr/\u003e![rebasing](images/rebase.png)\n* **When to merge and When to rebase**\n    * What is more valuable for you? The clean, linear history or the ability to trace your branches?\n    * Rebase for first case and merge for the second one.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvantamnguyen%2Fgit-concepts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvantamnguyen%2Fgit-concepts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvantamnguyen%2Fgit-concepts/lists"}