Menu

Showing posts with label URL. Show all posts
Showing posts with label URL. Show all posts

Tuesday, February 2, 2021

[GIT] วิธีการเพิ่ม Remote URL ของ GIT Repository
[GIT] How to Add New Remote URL of GIT Repository

 การเปลี่ยน Remote URL ของ GIT Repository จำเป็นต้องใช้ 2 คำสั่งดังนี้

  • คำสั่งสำหรับตรวจสอบ GIT remote URL ปัจจุบัน
    git remote -v
  • คำสั่งสำหรับตั้งค่า Remote URL ของ GIT Repository ใหม่
    git remote add <new_remote_name> <new_git_remote_url>
ตัวอย่างการใช้งาน เช่น
$ git remote -v
origin  git@github.com:username/project.git (fetch)
origin  git@github.com:username/project.git (push)
$ git remote add test git@github.com:username/project2.git
$ git remote -v 
origin  git@github.com:username/project.git (fetch)
origin  git@github.com:username/project.git (push)
test git@github.com:username/project2.git (fetch)
test git@github.com:username/project2.git (push)

ข้อมูลเพิ่มเติม สามารถอ่านได้ที่ Adding a remote

Monday, September 2, 2019

[GIT] วิธีการเปลี่ยน Remote URL ของ GIT Repository
[GIT] How to Change Remote URL of GIT Repository

การเปลี่ยน Remote URL ของ GIT Repository จำเป็นต้องใช้ 2 คำสั่งดังนี้
  • คำสั่งสำหรับตรวจสอบ GIT remote URL ปัจจุบัน
    git remote -v
  • คำสั่งสำหรับตั้งค่า Remote URL ของ GIT Repository ใหม่
    git remote set-url <current_remote_name> <new_git_remote_url>
โดยที่ new_git_remote_url จะมีรูปแบบ URL ดังนี้
  • URL สำหรับ HTTPS
    https://github.com/USERNAME/REPOSITORY.git
  • URL สำหรับ SSH
    git@github.com:USERNAME/REPOSITORY.git