GETTING STARTED WITH GIT

(Common Version-Control Terminologies)


This is PART-02 of the Yet Another GIT-Reference series.

Now there are some terminologies you NEED to understand when using GIT [or any other Version-Control-System] & I’ll list out some of the necessary ones --->>

  1. REMOTE-REPOSITORY
  2. A “Repository” is a place or any computer that stores your GIT projects, it’s also called “Repo” for short & it’s called “Remote” because, it’s located AWAY on a remote location away from your “Local-Machine” [AKA your computer]

  3. LOCAL-REPOSITORY
  4. It’s a Folder/Directory IN your computer that CONTAINS your project. [E.g: Here your folder “TEST” along with the “.git” Sub-Folder is your Local-Repo while your “grocery-list” is the project]

  5. WORKING-DIRECTORY
  6. They’re called “Working-Directory” because you WORK on your Projects within this directory/folder. [E.g: Here your folder “TEST” is the WORKING-DIRECTORY]

  7. CLONE
  8. The name is pretty self-explaining; it’s a completely-perfect copy of the entire Remote-Repo/Project. You essentially get all the files & history of your remote-repo.

  9. STAGING-AREA/INDEX
  10. The name is pretty self-explaining too; it’s an index of the changes you made to your project/work which can be modified/reviewed before confirming it.

  11. COMMIT
  12. Here COMMIT means confirming all the changes that you added to the Index/Staging-Area; So here you are committing the changes to your local-repo.

  13. PUSH
  14. Here PUSH simply means Copying the contents of your Local-Repo TO your Remote-Repo.This will also UPDATE your Remote-Repo with the changes you committed to your Local-Repo, if there was content already present in the Remote-Repo.

  15. ORIGIN
  16. ORIGIN basically represents the Remote-Repository that you're connected to in order to Push changes from your Local-Repository.

  17. BRANCH
  18. It is an isolated copy of your repo along with the history of your commits specific to that branch [Commits are recorded in the history of the CURRENT BRANCH THAT YOU ARE ON] You can switch between multiple branches & the main branch is called “MASTER/MAIN” Hence you can work on a copy of your work without changing your original in case of any errors made.

  19. FETCH
  20. It is when you obtain the commits from your remote-repo [or more specifically a BRANCH of your Remote-Repo] in order to synchronize with your local-repo in order to review them.

  21. MERGE
  22. It’s pretty self-explaining; It means to take the commits from one branch & combine them with another [Usually outdated/older branch].

  23. PULL
  24. Basically in nutshell "Fetching + Merging = PULL", which is done to save time & is the usually what developers use instead of separately using "fetch" & "merge".So it PULLS the changes & merges it with your Local-Repo.

  25. PULL-REQUEST/MERGE-REQUEST
  26. When someone copies your Remote-Repository & makes changes/modifications to it & REQUESTS you to PULL/MERGE their changes into your Local/Remote Repository [Presumably your Remote-Repository], it's called a “PULL-REQUEST” [since the command to download & merge changes is "git pull"] Although it's also called MERGE-REGUEST in some cases.