Wednesday, September 14, 2022

Git Command Untuk Hapus Folder di Github atau GitLab


Untuk menghapus File yang di Github atau GitLab bisa menggunakan perintah :

1
2
3
git rm Namafile.txt
git commit -m "Menghapus File"
git push origin master


Untuk menghapus Folder yang di Github atau GitLab bisa menggunakan perintah :

1
2
3
git rm -r NamaFolder
git commit -m "Menghapus Folder"
git push origin master


perintah diatas menghapus file yang di repository git, juga menghapus file yg ada di local repository.

Untuk menghapus file yang hanya ada di repository git, tanpa menghapus file yang ada di local repository
gunakan :

1
2
3
git rm --cached NamaFile.txt
git commit -m "Hapus File "
git push origin master

Untuk menghapus Folder yang hanya ada di repository git, tanpa menghapus file yang ada di local repository
gunakan :

1
2
3
git rm -r --cached NamaFolder
git commit -m "Hapus Folder "
git push origin master


Artikel Terkait


EmoticonEmoticon