Github error: A lock file already exists in the repository...
Ilustrasi

Github error: A lock file already exists in the repository...

Posting artikel baru ke blog berbasis Hugo via Github hosting mengalami error message: “A lock file already exists in the repository, which blocks this operation”.

Pesan error ini disebabkan saat app Github Desktop menjalankan perintah commit atau git push ke repo Github, komputer mati mendadak akibat padam listrik.

Pesan error A lock file already exists in the repository...
Pesan error A lock file already exists in the repository...

Solusi untuk mengatasi pesan error “A lock file already exists in the repository, which blocks this operation from completing” ternyata gampang sekali.

Cukup menghapus file index.lock di dalam subfolder .git yang berada dalam folder repository Hugo Github.

Hapus file index.lock di dalam repository
Hapus file index.lock di dalam repository

Melalui jendela terminal type: $ rm -rf ./.git/index.lock

Setelah itu, jalankan lagi perintah commit to master dan push origin. Simsalabim pesan error “A lock file already exists in the repository, which blocks this operation from completing” hilang seketika.

Menampilkan folder .Git yang tersembunyi di macOS

By default folder .git terhidden yang berada di lokal repository.

Untuk menampilkan file dan folder yang tersembunyi di macOS tidak semudah di system Windows:

Melalui Windows Explorer -> pilih menu View -> Option -> Change folder and search options. Lalu klik tab View di bagian Change folder and search options. Kemudian centang Show hidden files, folders, and drives terakhir OK.

Salah satu cara mudah sistem macOS ‘view hidden files’ melalui jendela terminal:

Type: $ defaults write com.apple.Finder AppleShowAllFiles true.

Setelah itu type lagi: $ killall Finder.

macOS show hidden file and folder
macOS show hidden file and folder

Setelah itu, buka lagi folder repository Hugo dan folder .Git sudah tampil.

Oya, untuk menyembunyikan lagi file dan folder di sistem macOS, cukup ganti perintah $ defaults write com.apple.Finder AppleShowAllFiles false.

Perintah $ defaults write com.apple.Finder AppleShowAllFiles memiliki dua opsi: true or false.

Jangan lupa untuk $ killall Finder lagi.

Comment

comments powered by Disqus