SlideShare a Scribd company logo
nge-Git
bareng Mizan
Perkenalkan
Mizan
General Manager T’Lab
http://tlab.co.id
Pengguna Git
Ilkomp 2006
Semacam apa Git ?
Git
Open source
distributed version control system
designed for speed & efficiency
Apa pula Version Control?
● Sistem untuk mencatat perubahan data
● Memungkinkan pengembangan secara bersama
● Tahu siapa yang merubah dan kapan data dirubah
● Memungkinkan mengembalikan data seperti semula
Version Control
Git
mercurial (hg)
bazaar
subversion (svn)
concurrent version system (cvs)
perforce
visual source safe
Contoh Version Control
Apa maksud
distributed version control ?
(Hampir) semua data berada di lokal
Keuntungan Data di Lokal
● Ada backup
● Bekerja jadi lebih cepat
● Bekerja offline (tanpa koneksi internet)
Apa yang bisa dilakukan tanpa Internet
● Performing a diff
● Viewing file history
● Committing change
● Merging branches
● Obtaining other revisions of a ifle
● Switching branches
Maksud
“designed for speed & efficiency” ?
Data (hampir) tidak dihapus
Data di-Snapshots
Perbedaan Patch & Snapshots
Storing data as changes to a
base version of each file
Storing data as snapshots of the
project over time
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Basic Git
Langkah awal
$ git config --global user.name “Mizan”
$ git config --global user.email “baobaz@gmail.com”
Getting a Repo
Membuat Repo
Git init
$ touch README.md
$ git init
$ tree -a
.
├── .git
│ ├── branches
│ ├── config
│ ├── description
│ ├── HEAD
│ ├── hooks
│ │ ├── applypatch-msg.sample
│ │ ├── commit-msg.sample
│ │ ├── post-update.sample
│ │ ├── pre-applypatch.sample
│ │ ├── pre-commit.sample
│ │ ├── prepare-commit-msg.sample
│ │ ├── pre-push.sample
│ │ ├── pre-rebase.sample
│ │ └── update.sample
│ ├── info
│ │ └── exclude
│ ├── objects
│ │ ├── info
│ │ └── pack
│ └── refs
│ ├── heads
│ └── tags
└── README.md
10 directories, 14 files
$ tree -a
.
├── .git
│ ├── branches
│ ├── config
│ ├── description
│ ├── HEAD
│ ├── hooks
│ │ ├── applypatch-msg.sample
│ │ ├── commit-msg.sample
│ │ ├── post-update.sample
│ │ ├── pre-applypatch.sample
│ │ ├── pre-commit.sample
│ │ ├── prepare-commit-msg.sample
│ │ ├── pre-push.sample
│ │ ├── pre-rebase.sample
│ │ └── update.sample
│ ├── info
│ │ └── exclude
│ ├── objects
│ │ ├── info
│ │ └── pack
│ └── refs
│ ├── heads
│ └── tags
└── README.md
10 directories, 14 files
$ touch README.md
$ git init
$ git add .
tree -a
.
├── .git
│ ├── branches
│ ├── config
│ ├── description
│ ├── HEAD
│ ├── hooks
│ │ ├── applypatch-msg.sample
│ │ ├── commit-msg.sample
│ │ ├── post-update.sample
│ │ ├── pre-applypatch.sample
│ │ ├── pre-commit.sample
│ │ ├── prepare-commit-msg.sample
│ │ ├── pre-push.sample
│ │ ├── pre-rebase.sample
│ │ └── update.sample
│ ├── index
│ ├── info
│ │ └── exclude
│ ├── objects
│ │ ├── e6
│ │ │ └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391
│ │ ├── info
│ │ └── pack
│ └── refs
│ ├── heads
│ └── tags
└── README.md
11 directories, 16 files
$ touch README.md
$ git init
$ git add .
$ git commit -m ‘first commit’
tree -a
.
├── .git
│ ├── branches
│ ├── COMMIT_EDITMSG
│ ├── config
│ ├── description
│ ├── HEAD
│ ├── hooks
│ │ ├── applypatch-msg.sample
│ │ ├── commit-msg.sample
│ │ ├── post-update.sample
│ │ ├── pre-applypatch.sample
│ │ ├── pre-commit.sample
│ │ ├── prepare-commit-msg.sample
│ │ ├── pre-push.sample
│ │ ├── pre-rebase.sample
│ │ └── update.sample
│ ├── index
│ ├── info / exclude
│ ├── logs
│ │ ├── HEAD
│ │ └── refs / heads / master
│ ├── objects
│ │ ├── e6 / 9de29bb2d1d6434b8b29ae775ad8c2e48c5391
│ │ ├── f9 / 3e3a1a1525fb5b91020da86e44810c87a2d7bc
│ │ ├── ff / 0952b14f24609b47d910df46ee944650f60054
│ │ ├── info
│ │ └── pack
│ └── refs
│ ├── heads / master
│ └── tags
└── README.md
16 directories, 22 files
Membuat Repo Clone
Git Clone
$ git clone git@github.com:laravel/laravel.git
Atau
$ git clone https://github.com/laravel/laravel.git
$ git clone https://github.com/laravel/laravel.git
Cloning into 'laravel'...
remote: Counting objects: 25800, done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 25800 (delta 23), reused 0 (delta 0), pack-reused 25759
Receiving objects: 100% (25800/25800), 9.69 MiB | 116.00 KiB/s, done.
Resolving deltas: 100% (12922/12922), done.
Checking connectivity... done.
$ cd laravel
$ ls
app composer.json gulpfile.js phpunit.xml resources tests
artisan config package.json public server.php
bootstrap database phpspec.yml readme.md storage
A Basic Workflow
A Basic Workflow
● Edit files
● Stage the changes
● Review your changes
● Commit the changes
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
A Basic Workflow
● Edit files
● Stage the changes
● Review your changes
● Commit the changes
$ vim README.md
# My First Git
Senangnya bisa menggunakan git
$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in..
modified: README.md
no changes added to commit (use "git add" and/or "git com..
A Basic Workflow
● Edit files
● Stage the changes
● Review your changes
● Commit the changes
Git Add
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
$ git add .
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: README.md
$ git add .
$ git status
On branch master
Changes THAT ARE STAGED:
(use "git reset HEAD <file>..." to unstage)
modified: README.md
stage file
setelah melakukan perubahan
stage file
setelah melakukan perubahan
A Basic Workflow
● Edit files
● Stage the changes
● Review your changes
● Commit the changes
Git commit
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
$ git commit
mencoba commit
# Please enter the commit message for your changes. Lines ..
# with '#' will be ignored, and an empty message aborts ..
# On branch master
# Changes to be committed:
# modified: README.md
$ git commit
[master e0b06a1] mencoba commit
1 file changed, 4 insertions(+)
A Basic Workflow
● Edit files vim / emacs / etc
● Stage the changes git add (file)
● Review your changes git status
● Commit the changes git commit
A Basicer Workflow
● Edit files vim / emacs / etc
● Stage & Commit git commit -a
Another Basic Git
Another Basic Git
● Ignoring Files
● Removing Files
● Moving Files
Ignoring Files
.gitignore
$ touch .gitignore
$ vim .gitignore
.env
$ touch .env
$ git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be..
.gitignore
nothing added to commit but untracked files present..
$ git add .
$ git commit -m ‘add gitignore’
Removing Files
git rm <file>
$ git rm README.md
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: README.md
Moving Files
git mv <file>
$ git mv README.md README
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
renamed: README.md -> README
Undo
Undo Commit
git commit --amend
Unstaging a Staged File
git reset HEAD <file>
Unmodifiying a Modified File
git checkout -- <file>
Branching
git branch & git checkout
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Git Merge
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Non linear development
● clone the code that is in production
● create a branch for issue #53 (iss53)
● work for 10 minutes
● someone ask for a hotfix for issue #102
● checkout ‘production’
● create a branch (iss102)
● fix the issue
● checkout ‘production’ merge ‘iss102’
● push ‘production’
● checkout ‘iss53’ and keep working
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Distributed Workflow
fetch, pull, & push
pull = fetch + merge
a Who in the what now?
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Multiple Remotes
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Popular Workflows
Central Repository Model
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Dictator and Lieutenants Model
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Integration Manager Model
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Remotes Are Branches
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
Working with Remotes
Showing Your Remotes
git remote
git remote -v
Adding Remote Repositories
git remote add <remote-name>
<URL>
Fetching & Pulling from Remotes
git remote <remote-name>
Pushing to Your Remotes
git push <remote> <branch>
Inspecting a Remote
git remote show <remote-name>
Renaming & Remove Remotes
git remote rename <remote-name>
<remote-newname>
git remote rm <remote-name>
Tagging
Listing Your Tags
git tag
Creating Tags
Lightweight tag Annotated tags
(pointer) (store as full object)
Annotated Tags
git tag -a <tagname>
Listing Lightweight Tags
git tag <tagname>
Tagging Later
git tag -a <tagname> <commit>
Sharing Tags
git push <remote> <tagname>
Checking out Tags
git checkout -b <branchname>
<tagname>
Thank you for watching
any question?

More Related Content

PPTX
Linux operating system ppt
DOCX
408372362-Student-Result-management-System-project-report-docx.docx
DOCX
SRS on airline reservation system
PPT
Communication primitives
PDF
File system is full - what do i do
PPT
Linux basics
PDF
Hadoop installation, Configuration, and Mapreduce program
PPTX
Send Sms with SmsManager Api In Android with Kotlin
Linux operating system ppt
408372362-Student-Result-management-System-project-report-docx.docx
SRS on airline reservation system
Communication primitives
File system is full - what do i do
Linux basics
Hadoop installation, Configuration, and Mapreduce program
Send Sms with SmsManager Api In Android with Kotlin

What's hot (20)

PPTX
UNIX Operating System
PDF
Concurrency
PDF
Final Year Projects (Computer Science 2013) - Syed Ubaid Ali Jafri
PPTX
Awt, Swing, Layout managers
PPT
Stack and heap allocation
PPTX
Linux Memory Management
PPT
Linux Performance Tunning Memory
PPT
Entity relationship diagram
PPTX
History of OS
PPTX
PPTX
Multithreading in java
PPT
Types of Load distributing algorithm in Distributed System
PPT
Linux os and its features
PDF
Parallel Algorithms
PPTX
Mysql python
PDF
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
PDF
CS9222 ADVANCED OPERATING SYSTEMS
PPTX
Online Medicine Store
PPTX
Swings in java
UNIX Operating System
Concurrency
Final Year Projects (Computer Science 2013) - Syed Ubaid Ali Jafri
Awt, Swing, Layout managers
Stack and heap allocation
Linux Memory Management
Linux Performance Tunning Memory
Entity relationship diagram
History of OS
Multithreading in java
Types of Load distributing algorithm in Distributed System
Linux os and its features
Parallel Algorithms
Mysql python
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
CS9222 ADVANCED OPERATING SYSTEMS
Online Medicine Store
Swings in java
Ad

Viewers also liked (20)

PDF
Laravel 5 Tutorial : Membuat Blog Sederhana dengan Laravel 5.3
PDF
Restful api design
PDF
Belajar laravel untuk pemula
PDF
Laravel Application Development
PDF
PROGRESS DEV - Basic Laravel 5.3 #1
PPTX
Introduction angular js
PPTX
Releasing the dopamine
PPT
PDF
Mari Memahami PSR (PHP Standards Recommendation)
PPT
Introduction to OOP with PHP
PDF
Tutorial dasar laravel
ODP
OOP Basic - PHP
DOCX
Fungsi-Fungsi PHP
PPTX
Laravel 5
PPTX
Laravel Tutorial PPT
PPTX
Laravel Beginners Tutorial 1
PDF
Mobile Hacking
KEY
Git with bitbucket (draft)
PPT
Creating a World-Class RESTful Web Services API
PPTX
Ejercicios resueltos de conjuntos
Laravel 5 Tutorial : Membuat Blog Sederhana dengan Laravel 5.3
Restful api design
Belajar laravel untuk pemula
Laravel Application Development
PROGRESS DEV - Basic Laravel 5.3 #1
Introduction angular js
Releasing the dopamine
Mari Memahami PSR (PHP Standards Recommendation)
Introduction to OOP with PHP
Tutorial dasar laravel
OOP Basic - PHP
Fungsi-Fungsi PHP
Laravel 5
Laravel Tutorial PPT
Laravel Beginners Tutorial 1
Mobile Hacking
Git with bitbucket (draft)
Creating a World-Class RESTful Web Services API
Ejercicios resueltos de conjuntos
Ad

Similar to Nge-GIT (Belajar Git Bareng) (20)

PDF
Git and github 101
PDF
Pro git - grasping it conceptually
PDF
GIT Basics
PPTX
git.ppt.pptx power point presentation got Google internet
PPT
Report about the dangers of git and github on the environment
PPT
Git-GitHub.ppt Diploma in computer. engineering
PPT
Distributed Version control using Git and Github
PDF
Wokshop de Git
PPTX
github ppt git ppt on git hub to know ab
PDF
Git Started With Git
PDF
Git - Get Ready To Use It
PDF
Git basics
PPTX
Working with Git
PDF
Git for beginners
PPTX
11 git version control
PPTX
Git and git workflow best practice
PDF
Git_real_slides
PDF
Git real slides
PDF
Loading...git
Git and github 101
Pro git - grasping it conceptually
GIT Basics
git.ppt.pptx power point presentation got Google internet
Report about the dangers of git and github on the environment
Git-GitHub.ppt Diploma in computer. engineering
Distributed Version control using Git and Github
Wokshop de Git
github ppt git ppt on git hub to know ab
Git Started With Git
Git - Get Ready To Use It
Git basics
Working with Git
Git for beginners
11 git version control
Git and git workflow best practice
Git_real_slides
Git real slides
Loading...git

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Machine learning based COVID-19 study performance prediction
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
KodekX | Application Modernization Development
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation theory and applications.pdf
PPT
Teaching material agriculture food technology
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
Machine learning based COVID-19 study performance prediction
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Reach Out and Touch Someone: Haptics and Empathic Computing
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Building Integrated photovoltaic BIPV_UPV.pdf
KodekX | Application Modernization Development
Advanced methodologies resolving dimensionality complications for autism neur...
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
Encapsulation theory and applications.pdf
Teaching material agriculture food technology
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Big Data Technologies - Introduction.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
20250228 LYD VKU AI Blended-Learning.pptx

Nge-GIT (Belajar Git Bareng)

  • 5. Git Open source distributed version control system designed for speed & efficiency
  • 6. Apa pula Version Control?
  • 7. ● Sistem untuk mencatat perubahan data ● Memungkinkan pengembangan secara bersama ● Tahu siapa yang merubah dan kapan data dirubah ● Memungkinkan mengembalikan data seperti semula Version Control
  • 8. Git mercurial (hg) bazaar subversion (svn) concurrent version system (cvs) perforce visual source safe Contoh Version Control
  • 10. (Hampir) semua data berada di lokal
  • 11. Keuntungan Data di Lokal ● Ada backup ● Bekerja jadi lebih cepat ● Bekerja offline (tanpa koneksi internet)
  • 12. Apa yang bisa dilakukan tanpa Internet ● Performing a diff ● Viewing file history ● Committing change ● Merging branches ● Obtaining other revisions of a ifle ● Switching branches
  • 13. Maksud “designed for speed & efficiency” ?
  • 14. Data (hampir) tidak dihapus Data di-Snapshots
  • 15. Perbedaan Patch & Snapshots Storing data as changes to a base version of each file Storing data as snapshots of the project over time
  • 33. $ git config --global user.name “Mizan” $ git config --global user.email “baobaz@gmail.com”
  • 38. $ tree -a . ├── .git │ ├── branches │ ├── config │ ├── description │ ├── HEAD │ ├── hooks │ │ ├── applypatch-msg.sample │ │ ├── commit-msg.sample │ │ ├── post-update.sample │ │ ├── pre-applypatch.sample │ │ ├── pre-commit.sample │ │ ├── prepare-commit-msg.sample │ │ ├── pre-push.sample │ │ ├── pre-rebase.sample │ │ └── update.sample │ ├── info │ │ └── exclude │ ├── objects │ │ ├── info │ │ └── pack │ └── refs │ ├── heads │ └── tags └── README.md 10 directories, 14 files
  • 39. $ tree -a . ├── .git │ ├── branches │ ├── config │ ├── description │ ├── HEAD │ ├── hooks │ │ ├── applypatch-msg.sample │ │ ├── commit-msg.sample │ │ ├── post-update.sample │ │ ├── pre-applypatch.sample │ │ ├── pre-commit.sample │ │ ├── prepare-commit-msg.sample │ │ ├── pre-push.sample │ │ ├── pre-rebase.sample │ │ └── update.sample │ ├── info │ │ └── exclude │ ├── objects │ │ ├── info │ │ └── pack │ └── refs │ ├── heads │ └── tags └── README.md 10 directories, 14 files
  • 40. $ touch README.md $ git init $ git add .
  • 41. tree -a . ├── .git │ ├── branches │ ├── config │ ├── description │ ├── HEAD │ ├── hooks │ │ ├── applypatch-msg.sample │ │ ├── commit-msg.sample │ │ ├── post-update.sample │ │ ├── pre-applypatch.sample │ │ ├── pre-commit.sample │ │ ├── prepare-commit-msg.sample │ │ ├── pre-push.sample │ │ ├── pre-rebase.sample │ │ └── update.sample │ ├── index │ ├── info │ │ └── exclude │ ├── objects │ │ ├── e6 │ │ │ └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391 │ │ ├── info │ │ └── pack │ └── refs │ ├── heads │ └── tags └── README.md 11 directories, 16 files
  • 42. $ touch README.md $ git init $ git add . $ git commit -m ‘first commit’
  • 43. tree -a . ├── .git │ ├── branches │ ├── COMMIT_EDITMSG │ ├── config │ ├── description │ ├── HEAD │ ├── hooks │ │ ├── applypatch-msg.sample │ │ ├── commit-msg.sample │ │ ├── post-update.sample │ │ ├── pre-applypatch.sample │ │ ├── pre-commit.sample │ │ ├── prepare-commit-msg.sample │ │ ├── pre-push.sample │ │ ├── pre-rebase.sample │ │ └── update.sample │ ├── index │ ├── info / exclude │ ├── logs │ │ ├── HEAD │ │ └── refs / heads / master │ ├── objects │ │ ├── e6 / 9de29bb2d1d6434b8b29ae775ad8c2e48c5391 │ │ ├── f9 / 3e3a1a1525fb5b91020da86e44810c87a2d7bc │ │ ├── ff / 0952b14f24609b47d910df46ee944650f60054 │ │ ├── info │ │ └── pack │ └── refs │ ├── heads / master │ └── tags └── README.md 16 directories, 22 files
  • 46. $ git clone git@github.com:laravel/laravel.git Atau $ git clone https://github.com/laravel/laravel.git
  • 47. $ git clone https://github.com/laravel/laravel.git Cloning into 'laravel'... remote: Counting objects: 25800, done. remote: Compressing objects: 100% (41/41), done. remote: Total 25800 (delta 23), reused 0 (delta 0), pack-reused 25759 Receiving objects: 100% (25800/25800), 9.69 MiB | 116.00 KiB/s, done. Resolving deltas: 100% (12922/12922), done. Checking connectivity... done. $ cd laravel $ ls app composer.json gulpfile.js phpunit.xml resources tests artisan config package.json public server.php bootstrap database phpspec.yml readme.md storage
  • 49. A Basic Workflow ● Edit files ● Stage the changes ● Review your changes ● Commit the changes
  • 54. A Basic Workflow ● Edit files ● Stage the changes ● Review your changes ● Commit the changes
  • 55. $ vim README.md # My First Git Senangnya bisa menggunakan git
  • 56. $ git status On branch master Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in.. modified: README.md no changes added to commit (use "git add" and/or "git com..
  • 57. A Basic Workflow ● Edit files ● Stage the changes ● Review your changes ● Commit the changes
  • 61. $ git add . $ git status On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: README.md
  • 62. $ git add . $ git status On branch master Changes THAT ARE STAGED: (use "git reset HEAD <file>..." to unstage) modified: README.md
  • 65. A Basic Workflow ● Edit files ● Stage the changes ● Review your changes ● Commit the changes
  • 69. $ git commit mencoba commit # Please enter the commit message for your changes. Lines .. # with '#' will be ignored, and an empty message aborts .. # On branch master # Changes to be committed: # modified: README.md
  • 70. $ git commit [master e0b06a1] mencoba commit 1 file changed, 4 insertions(+)
  • 71. A Basic Workflow ● Edit files vim / emacs / etc ● Stage the changes git add (file) ● Review your changes git status ● Commit the changes git commit
  • 72. A Basicer Workflow ● Edit files vim / emacs / etc ● Stage & Commit git commit -a
  • 74. Another Basic Git ● Ignoring Files ● Removing Files ● Moving Files
  • 76. $ touch .gitignore $ vim .gitignore .env $ touch .env $ git status On branch master Untracked files: (use "git add <file>..." to include in what will be.. .gitignore nothing added to commit but untracked files present.. $ git add . $ git commit -m ‘add gitignore’
  • 78. $ git rm README.md $ git status On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) deleted: README.md
  • 80. $ git mv README.md README $ git status On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) renamed: README.md -> README
  • 81. Undo
  • 83. Unstaging a Staged File git reset HEAD <file>
  • 84. Unmodifiying a Modified File git checkout -- <file>
  • 86. git branch & git checkout
  • 113. ● clone the code that is in production ● create a branch for issue #53 (iss53) ● work for 10 minutes ● someone ask for a hotfix for issue #102 ● checkout ‘production’ ● create a branch (iss102) ● fix the issue ● checkout ‘production’ merge ‘iss102’ ● push ‘production’ ● checkout ‘iss53’ and keep working
  • 126. pull = fetch + merge
  • 127. a Who in the what now?
  • 206. Showing Your Remotes git remote git remote -v
  • 207. Adding Remote Repositories git remote add <remote-name> <URL>
  • 208. Fetching & Pulling from Remotes git remote <remote-name>
  • 209. Pushing to Your Remotes git push <remote> <branch>
  • 210. Inspecting a Remote git remote show <remote-name>
  • 211. Renaming & Remove Remotes git remote rename <remote-name> <remote-newname> git remote rm <remote-name>
  • 214. Creating Tags Lightweight tag Annotated tags (pointer) (store as full object)
  • 215. Annotated Tags git tag -a <tagname>
  • 217. Tagging Later git tag -a <tagname> <commit>
  • 218. Sharing Tags git push <remote> <tagname>
  • 219. Checking out Tags git checkout -b <branchname> <tagname>
  • 220. Thank you for watching any question?