0% found this document useful (0 votes)
13 views

Session 3 - VCS Part 1-1

Uploaded by

NS Shop
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Session 3 - VCS Part 1-1

Uploaded by

NS Shop
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Full-stack Developer

Version Control
System Part 1

Restricted - For Student Only


Today’s Tutor
Zainal Hasan - Senior Backend Engineer – Horego

Experience :
● Senior Backend Engineer at Horego (Jun 2023-Now)
● Private Mentor with predicate “Duta Besar” at
Superprof Indonesia (2020-Now)
● Backend Engineer at Printerous (Nov 2021-May 2023)
● Full Stack Developer at MatchKerja (Jan 2021-Aug
2021)
● Founder & Web Developer at Gazeboin (Nov 2017-Oct
2020)
Understand the differences between
01
Class
Git, Github and Gitlab
02 Install and configure Git for use

Agenda 03
Use Git to manage files using CLI
commands
The Details 04 Manage Remote Repositories
Understand The
Differences Between
Git, Github and
Gitlab
Version Control is a system that records
changes to a file or set of files over time so
that you can recall specific versions later.

What is Version
Control System?
To better understand Git, we must
understand version control first.

Selanjutnya dalam ruang kerja teknologi


Git is a distributed version control system.
Tracking changes in any set of files, usually
used for coordinating work among
What is Git? programmers collaboratively developing
source code during software development.

To better understand Git, we must


understand version control first.

Selanjutnya dalam ruang kerja teknologi


Distributed development

What for? Compatibility with existing systems and protocols

Maintaining a history of Efficient handling of large projects


what changes have
happened your code Periodic explicit object packing

Cryptographic authentication of history


Github and Gitlab is many examples of an internet hosting

What is service for software development and version control using


Git.

Github and
Gitlab?

>
Platform’s main advantages and
disadvantages and determine their
use cases: link
Install and
Configure Git
Ensure Git is installed
Run this command in your terminal:

git /-version

Windows via Git SCM

Installing Git
Download & open downloaded file

https://github.com/git-for-windows/git/releases/download/
v2.43.0.windows.1/Git-2.43.0-32-bit.exe
Before you start using Git, you have
to make install it on your computer. Mac OS via Homebrew
Usually, Git is pre-installed in Linux Run this command in your terminal:
and Mac OS.
brew install git
You should skip this step if your Git is already
installed. Linux via apt
Run this command in your terminal:
Selanjutnya
sudo apt-getdalam ruang
install kerja teknologi
git
Register to Github
You can skip this step if already have an account.

https://github.com/signup

Configuring
your Git
Register to Github and configure
your Git.
Selanjutnya dalam ruang kerja teknologi
Configure your Git
You should skip this step if your Git already Run this command in your terminal / command prompt:
configured with your Github account.
git config /-global user.name “<username>”
git config /-global user.email “<email>”
Use Git to manage
files using CLI
commands
Open your terminal
On Windows, we will always use Git Bash instead of
Powershell or Command Prompt as our terminal. But, on
Linux or Mac OS, you can use any Terminal.

Create new project folder and add some file


Run this command in your terminal:

mkdir <folder-name>
Initiate Git (1) cd <folder-name>
git init

Let’s init git on our project

Selanjutnya dalam ruang kerja teknologi


Create some file and check git status
Run this command in your terminal:

git status

Add file changes & commit


Initiate Git (2) Run this command in your terminal:

git add file1.txt


Let’s add some file and commit git commit -m “<commit-message>”

changes on our project


Add another file changes & commit
Run this command in your terminal:

git add file1.txt file2.txt


git commit -m “<commit-message>”
Selanjutnya dalam ruang kerja teknologi
Manage Remote
Repositories
Open Github to create a remote repository
Open https://github.com/new and fill in the repository name

Manage
Remote
Repositories (1)

Selanjutnya dalam ruang kerja teknologi


Setup remote repo on our local repo
Run this command in your terminal:

git remote add origin


https://github.com/zhanang19/bootcamp-harisenin-

Manage vcs.git

Push changes in local repo to remote repo


Remote Run this command in your terminal:

git branch -M main


Repositories (2) git push -u origin main

Check remote repo


Open this URL in your browser::

https://github.com/zhanang19/bootcamp-harisenin-
vcs
Selanjutnya dalam ruang kerja teknologi
Clone remote repo on different folder/computer
Let say we want to clone existing remote repo to our computer
with named folder `bootcamp-vcs`

Run this command in your terminal:

Manage git clone <repository-url> <folder-name>

Remote
Repositories (3)

Selanjutnya dalam ruang kerja teknologi


Do you have
any questions?
Source Material
How to Install Git by Atlassian
About Version Control by Git SCM

You might also like