Git – Xóa remote repository

Trường hợp bạn đã thêm một remote repo nhưng sau đó bạn nhận thấy đã thêm nhầm link, hoặc bạn muốn xóa nó để thêm một remote khác thì có thể sử dụng lệnh xóa remote của git.

Mục lục

1. Remove remote repository

Để xóa một remote thì bạn sử dụng cú pháp sau:

git remote rm remote_name

Trong đó remote_name là tên mà bạn đã đặt lúc thêm remote.

git remote rm amzuni

Ví dụ: Xóa remote amzuni 

remote remote repo png

2. Vấn đề gặp phải khi xóa

Nếu bạn xóa một remote không tồn tại thì sẽ xuất hiện lỗi “fatal: No such remote: remote_name“. Ví dụ mình xóa remote freetuts_cuong nhưng remote này không hề tồn tại nên sẽ nhận được thông báo lỗi là “fatal: No such remote: amzuni“.