Difference between revisions of "Git"

From belajarwiki
Jump to navigation Jump to search
(Created page with "Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to lea...")
 
Line 13: Line 13:
 
Untuk pertama kali, perlu kita setting beberapa hal:
 
Untuk pertama kali, perlu kita setting beberapa hal:
  
# Login git via terminal
+
*Login git via terminal
  
 
  git config --global user.name "username"
 
  git config --global user.name "username"
Line 19: Line 19:
 
  git config --list
 
  git config --list
  
# Login dan buat repo di github.com atau gitlab.com
+
*Login dan buat repo di github.com atau gitlab.com
  
# Cara setting agar dapat remote git dari file lokal
+
*Cara setting agar dapat remote git dari file lokal
 
  git init
 
  git init
 
  git remote add origin git@github.com:UserNameGit/NamaRepository.git
 
  git remote add origin git@github.com:UserNameGit/NamaRepository.git
  
# Menambahkan file
+
*Menambahkan file
 
  git add index.php
 
  git add index.php
 
  git commit -m "first commit"
 
  git commit -m "first commit"
 
  git push origin master
 
  git push origin master
  
# Mengambil file
+
*Mengambil file
 
  git pull origin master
 
  git pull origin master
 
   
 
   

Revision as of 07:03, 1 April 2022

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

Instalasi

Pada ubuntu

add-apt-repository ppa:git-core/ppa 
apt update
apt install git

Cara menggunakan git

Untuk pertama kali, perlu kita setting beberapa hal:

  • Login git via terminal
git config --global user.name "username"
git config --global user.email user@mail.com
git config --list
  • Login dan buat repo di github.com atau gitlab.com
  • Cara setting agar dapat remote git dari file lokal
git init
git remote add origin git@github.com:UserNameGit/NamaRepository.git
  • Menambahkan file
git add index.php
git commit -m "first commit"
git push origin master
  • Mengambil file
git pull origin master


Referensi