Git Part 2: Basic Terms & Commands
First - “Repository”
Its literal translation is “repository” or “storage”.
It's also called “Repo”.
There are "remote" and "local" repositories in types.
To put it simply,
you can consider the project folder becomes a “local storage” through Git.
The second term is "Branch".
As the word describes,
it means “code branching”.
It’s like dividing train tracks,
extending the code branch to the side
allows you to work and merge once it’s the development is done safely.
No need to go too deep for now,
as you will understand more during the part 3, “Practice” session.
Next, let's review the basic git commands.
A few things to mention before we begin...
Don’t try to memorize all of these Git commands at first.
Just start with grasping the basic concept,
review the basic commands, then…
“USE it"!
Git is not a programming language…
but a "tool" for collaboration in development.
The focus should be in “practical” proficiency.
If you get stuck, just look up (like you would for words you don't know) to learn and proceed.
[ on the screen: “Mastering Git does not make you an amazing programmer!”]
Now, the first command in Git is
"git init"… I-N-I-T
It’s a short form of “Initialize”.
"Repository initialization" of the project folder.
What is the repository — “storage", right?
Typing the “git init “command will initiate
tracking the code history
that is not visible in the project file folder.
I'll show you this when we practice (in Part 3).
"git clone"
With this command,
you can get a whole copy of a remote repository to your local repository.
Next, "git add"
It’s to prepare the version.
This command registers prepared code files and folders in the code “index”
as if loading them on a train.
Next is “git commit” and “tag”
These are very important commands.
In short, it’s like taking a snapshot of the code version with a tag
— so I can go back anytime.
“git status” and “git log”
These two commands are very often used.
Rather than doing something, they are checking the status and list;
like checking where is what, who put which luggage where…
“git checkout”
It's a powerful command.
This command allows you to change the version location.
In other words,
like a time machine or teleport,
you can freely and efficiently change to the old version or another branch.
The last command to review is “git push”.
Now that the local storage is ready…
the train (code version) departs to the remote storage
— this is the command to "upload".
At this point,
you need to clarify where the remote repository is and who you are.
Otherwise, the train cannot depart; "git push" won't work.
There are many other terms,
but this is the overview of the most commonly used git terms and commands
so now let's go into practice -- Part 3!
