Git Versioning System and what are Git-scm-Mercurial-scm-GitHub.com etc

Git~Mercurial~SVN यह सभी अलग अलग तरह की वर्ज़न कंट्रोल सिस्टम हैं।

  1. Git (created by Linus Torvalds, jokingly expanded as Global Information Tracker, Goddamn Idiotic Truckload or, meaning of ‘Git’ in another foreign language: Stupid Unpleasant Person) repositories or Mercurial (created by Matt Mackall in 2005) repositories or SVN repositories all are (local or centralized version control systems) VCSes.

  2. Further, Git-Scm.com [Scm= Software Code Management] is Official site for Git software & documentation, Git downloads, tutorials, and official docs (maintained by the Git community and also affiliated with the Software Freedom Conservancy). Since this site is not for storing Git repositories, no login or account creation is allowed here.

  3. Diff VCSes Hosting Services: GitHub.com (closed-source), BitBucket.com (closed source), GitLab.com (open-source), SourceForge.com (open-source) all are (local or distributed isn’t a big diff) VCS providers/repository hosts. But not all VCS repository hosts may offer all types of repositories hosting. E.g. GitHub.com doesn’t provide hosting for Mercurial repositories, but SourceHut.com does.

In my opinion, sourceforge is best option for me, as it is OpenSource, and unlike GitHub which only handles/offers git vcs services, offers hosting for both Git vcs and Mercurial Vcs and SubVersion vcs.

Type of Version Control systems: Centralized or Distributed

  1. Both Distbtd VCS and Centrlizd VCS host main/master copies of the repositories. The users of both (can) download (full copy of) any required version. But only users of DVCS have full repository copies on their local systems, while users of Cvcs have only those files (not full repositories) with them on which they need to work. In Cvcs only the server has full repositories with all current/old versions on it. Users have only those files which they need. While in Dvcs the server only has the latest version repository on it (and users have full copies on them). In yet other words, on Distributed systems, users work on full copies and upload them to Dstrbtd server for others to use them, while on Centeralized, the users download full/current copies to work on them (and optionally can upload them back). Also, SVN, CVS are examples of centralized vcs, and Git, Mercurial are examples of Distributed.

  2. Why do we call ‘GitHub’ or ‘GitLab’ or ‘BitBucket’ git hosting services, even when they (can) host Mercurial or Svn repositories also?
    Answer: They’re just named, and because of the dominance of ‘Git’ vcs for coming early on scene and being most popular and similar misc reasons, they’re named thus.

Steps of VCS:

After installing Git Vcs ware on your linux/windows system, you can give these commands to work on Git-Vcs:

  1. Git Init Project1 : creates a new vcs/git project with the creation of the same named folder (in our current path).
  2. Cd Project1: You’d now enter into that folder/project.
  3. create anyfile1.txt : Would create a new empty file in that very location (the same is not yet related to or part of our project).
  4. git add anyfile1.txt : Git would now know that this file exists for the project (and would be needed to be included when we commit our changes, in the next step).
  5. git commit -m “I-added-a-new-file” : first commit will be done with ‘m-’ adding the said message (so that all/others could know by seeing this message as to what was changed in this commit).

How to install Git repositories on Windows without exe executable files:

  1. The (or most) git repositories, which don’t have any windows executable files in the downloadable archives, mostly in zip format, have plateform independent files like txt, script or config files, which are same for Windows, Apple or Linux platforms/systems). Mostly, GitHub repositories are generally cross-platform (unless OS-specific).
  2. Then they’ve actual source-code files, which need to be compiled with the help of library files of intended platforms.
  3. Then how can we download and install those on windows (always presume that I’m on Windows11). See below:

Git repositories often contain source code, not precompiled executables. If a repository doesn’t include a Windows executable, you’ll need to build the source code to create an executable for Windows. Here’s how you can do this:

  1. First, copy/Clone the Repository to your local machine, using Git, download the repository (often in plateform independent zip archive format) to your system (in bash):
  1. Install Build Tools. * For many projects, you’ll need specific tools depending on the programming language:
  • C/C++: Install Microsoft Visual Studio or MinGW.
  • Python: Install Python and pip.
  • Java: Install the Java Development Kit (JDK).
  • Node.js: Install Node.js.
  • Rust, Go, etc.: Install the respective language environment.
  1. Install Dependencies. Repositories often list dependencies. Use the appropriate package manager:
  • Python: pip install -r requirements.txt
  • Node.js: npm install
  • C/C++: Dependencies might be included or require manual installation.
  1. Run the Build Command, by following the commands provided in the repository’s documentation. Common build systems include:
  • CMake:
  • bash
  • Copy code
  • cmake . && cmake --build .
  • Make:
  • bash
  • Copy code
  • make
  • Python:
  • bash
  • Copy code
  • python setup. py install
  • Java:
  • bash
  • Copy code
  • mvn package
  1. Once built, you’ll find the executable (e.g., .exe file) in the specified directory (often bin or build), which now can be executed on your windows (or any other specific plateform).

All other git related commands:

  1. To see the public key(s) stored in your GitHub’s personal profile/settings thru a browser, go to this url: https://github.com/bathindahelper.keys. And thru a terminal: curl https://github.com/bathindahelper.keys
  2. To copy/fetch the Public ssh key stored in GitHub’s personal profile/settings to our local machine, we first need to install a package/ware, which can handle importing/exporting ssh-keys across remote (github) server to our local machine: apt install ssh-import-id
  3. Then, to copy/fetch the ssh key stored in GitHub’s personal profile/settings into your local /home/.ssh/authorized_keys file, command: ssh-import-id-gh bathindahelper. And to fetch the key stored on launchpad: ssh-import-id-lp USER_ID_1 [USER_ID_2]
  4. And then to view your local authorized file., to see if the key fetched is indeed there: cat ~/.ssh/authorized_keys