YET ANOTHER GIT-REFERENCE (ver-4.0)
As indicated by the name this reference isn't anything special & it's dime-a-dozen, still I want to ATTEMPT at writing a reference guide so that even a "not so tech-savvy" individual can use it. GIT is a version control system (AKA V.C.S). GIT is essentially a way for you to save your files & directories.
GIT records differences in the files and folders AND keeps a historical record of each save & Remember all GIT does is track versions & the changes each future updates make, so it can actually be used in things OTHER THAN JUST CODING.
Since GIT is a command-line tool,this guide as usual will be Linux-focused & Command-Line focused; since they have an awesome command-line experience. Since we are going to be Linux-Focused (Debian/Ubuntu-based Linux distributions/Systems to be Precise for now) let’s start with it’s installation & it’s simple, All you have to do is type:-
sudo apt install git
OR as an alternative type this:
sudo apt install git-all
Although most Linux-based Operating Systems/Distributions have it Pre-Installed.For Windows you can simply use GIT-Bash or follow GIT-Installation Documentation
FIRST-TIME SETUP FOR GIT VERSION-CONTROL-SYSTEM
Firstly, before doing anything we need to configure/setup some things:-
- REMOTE SETUP
- LOCAL SETUP
- CONFIGURING YOUR IDENTITY
- CONFIGURING YOUR EDITOR
[For a Self-Hosted one, simply follow it's documentation]
All we need to do is create an account in any one of the GIT-Hosting services, Here are some of the Sites/Platforms with their Links:-
Next; create a repository under your said account in your GIT-Hosting service of your choice, there are documentations to show you what you need to do in order to make one if you find it troublesome, Usually it right in front of you, it’s easy.( & Let’s call the repository “MY_REPO”)
However; You can also SELF-HOST your own GIT-Instance/Service via CERTAIN TOOLKITS & here are some of them with Links:-
But this is an advanced topic & we’ll learn in the near/distant future if fortune favors it :-)
[Very convenient, ESPECIALLY when using a Self-Hosted GIT-Service]
you have to set "YOUR_NAME"& in order to do exactly that the command is:
git config --global user.name "YOUR_NAME"
& For setting "YOUR_EMAIL"-Address, the command is:
git config --global user.email YOUR_EMAIL
This step may not be necessary [If not configured, GIT uses your system’s default editor, which is usually NANO & it's easy to use.]
But just in case, let’s cover this. Since you’ll be using the Command-Line Interface [CLI for short] a lot here
So In order to set a different text-editor as the default text-editor [e.g: Here we’ll use “micro” as an example of another CLI-Based editor] in order to write stuff like “Commit-Messages” the command is as follows:-
git config --global core.editor micro
You will only need to do all of the above actions ONCE & If you want to check your configuration settings, you can use the following command to list all the settings GIT can find:-
git config --list
This is PART-01 & the INDEX of the Yet Another GIT-Reference series.
The Collection of Articles listed here will be posted separately in my website, so that you can access them individually at your convenience.
[here, T.B.P means "To Be Posted"]
PARTS | ARTICLES |
---|---|
II = | Getting Started With GIT |
III = | Basic Operations With GIT |
IV = | Securing Your GIT Repositories |