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