List

Tools

install git kat komputer

#npm install git

daftar akaun kt github.com

create repository

buat folder learn-git

init git

#cd learn-git/
#git init

create file dalam folder learn-git

1. README.md
2. credential.md
3. .gitignore

.gitignore ni digunakan utk exclude file yang akan push ke github. senaraikan nama file dalam file.gitignore

contoh:

credential.md

jadi..

 

UMPs-MacBook-Pro-2:learn-git ump$ git status
On branch master

No commits yet

Untracked files:
(use “git add <file>…” to include in what will be committed)

.gitignore
readme.md

nothing added to commit but untracked files present (use “git add” to track)
UMPs-MacBook-Pro-2:learn-git ump$ git add .
UMPs-MacBook-Pro-2:learn-git ump$ git status
On branch master

No commits yet

Changes to be committed:
(use “git rm –cached <file>…” to unstage)

new file: .gitignore
new file: readme.md

cek status git menggunakan
#git status

pastu commit
#git commit -a -m “Initial”

a = add
m = message “Initial” (boleh ubah)

git diff

utk tgk beza yg telah dikemaskini

==============

 

…or create a new repository on the command line

echo "# learn-git" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/mohdsuhaimi/learn-git.git
git push -u origin master

…or push an existing repository from the command line

git remote add origin https://github.com/mohdsuhaimi/learn-git.git
git push -u origin master

===================

-basic command —

git –help – display all command in git
git clone – kopi sus kod dalam local repo
git init – initialize git repo
git status – view status
git diff – tgk perubahan
git log – tgk log audit trail
git add .
git commit -a -m “kambing ku”

git remote add bitbucket
git remote remove origin

-push to github repo account-

git remote add origin https://github.com/sabrisoft/learn-git.git
git push -u origin master

vscode

ctrl + enter = vscode = commit

 

Leave a Reply

Your email address will not be published. Required fields are marked *

  Posts

1 2
September 20th, 2021

FortiClient VPN 7 with MacOS Big Sur 11 Issue [SOLVED]

January 6th, 2021

Drupal 8 – PHPMailer SMTP

June 23rd, 2020

Drupal 8 – Setup composer dalam macOS

June 15th, 2020

Flutter (Mac OS) – Penyediaan Persekitaran

March 14th, 2019

Drupal 8 – Composer, Drush & Git

January 3rd, 2019

Node JS – Authentication using JSON Web Token (JWT)

January 3rd, 2019

Node JS – Set config ENV (dotenv)

January 3rd, 2019

Cara setup dan guna GitHub

January 2nd, 2019

Node JS – Connect to database Oracle with knex

January 2nd, 2019

Node Js – Training 2