Skip to content

Latest commit

 

History

History
111 lines (70 loc) · 1.71 KB

github.md

File metadata and controls

111 lines (70 loc) · 1.71 KB
layout title permalink
page
Github Guide
/github/

Logout akun diterminal

git config --global --unset user.name
git config --global --unset user.email
git config --global --unset credential.helper

Remove SSH Keys

~/.ssh

Setup git

git init
git add README.md
git remote add origin [https://github.com/mhanifmuhsin/mDoc.git]
git add . 
git commit -m ["description"] 
git push -u origin [master]

keterangan : hapus kurung siku

Checkout dan membuat branch baru

git checkout -b [master]

keterangan : hapus kurung siku

Checkout (pindah branch)

git checkout [gh-pages]

keterangan : hapus kurung siku

Cara mengecek branch

git branch

Merge

git merge [nama branch yang mau digabungkan]

keterangan : hapus kurung siku

Berpindah remote URLs dari HTTPS ke SSH

$ git remote -v
# Melihat List remote yang ada
> origin  https://github.com/USERNAME/REPOSITORY.git (fetch)
> origin  https://github.com/USERNAME/REPOSITORY.git (push)

# Merubah remote
$ git remote set-url origin [email protected]:USERNAME/REPOSITORY.git

#Verifikasi ulang, perubahan remote
$ git remote -v
> origin  [email protected]:USERNAME/REPOSITORY.git (fetch)
> origin  [email protected]:USERNAME/REPOSITORY.git (push)

Berpindah remote URLs dari SSH ke HTTPS

$ git remote -v
# Melihat List remote yang ada
> origin  [email protected]:USERNAME/REPOSITORY.git (fetch)
> origin  [email protected]:USERNAME/REPOSITORY.git (push)

# Merubah remote
$ git remote set-url origin https://github.com/USERNAME/REPOSITORY.git

#Verifikasi ulang, perubahan remote
$ git remote -v
> origin  https://github.com/USERNAME/REPOSITORY.git (fetch)
> origin  https://github.com/USERNAME/REPOSITORY.git (push)