Menghapus Commit History di GitHub

Clone repository

[INPUT]

1 git clone https://github.com/username/project.git

Masuk ke folder project dan hapus folder .git

[INPUT]

1 2 cd project rm -rfv .git

Inisialisasi folder git dan tambahkan remote server github

[INPUT]

1 2 3 git init git remote add origin https://github.com/username/project.git git remote -v

Lakukan commit

[INPUT]

1 2 git add –all git commit -am “initial commit”

Terakhir push project ke GitHub

[INPUT]

1 git push -f origin master

Cek repository GitHub, semua commit telah terhapus dan yang tersisa hanya “initial commit”.

Leave a Reply

Your email address will not be published.