🇬🇧 05 — Deleting files and directories
Nothing is ever truly lost: a deletion is just another commit, and the old content stays in the history.
Deleting one file
- Open the file.
- Press the … menu at the top right of the file view.
- Choose Delete this file (or use the 🗑️ icon next to the edit pencil).
- Write a commit message and press Commit Changes.
Deleting a folder
- Open the folder.
- Press the … menu next to Add File.
- Choose Delete this directory.
- Commit.
Everything inside the folder is removed in that single commit.
Deleting several files at once
The browser deletes one path at a time. For a large clean-up, work from your computer (chapter 10):
git rm -r old-folder
git commit -m "remove old folder"
git push
Getting a deleted file back
- Open History on the folder that used to contain it, or the repository history.
- Find the commit before the deletion.
- Open the file at that commit and copy the content, or press Browse source at this point and recreate it.
Anything that was ever committed can be recovered. Something you typed in the editor but never committed cannot.
Careful with
- Deleting the folder instead of the file — check the menu title says file when you mean one file.
- Protected branches — if
mainis protected, deletion goes through a pull request instead (chapter 09). - Secrets — deleting a password from a file does not remove it from the history. Change the password itself.
🇹🇷 05 — Dosya ve dizin silme
Hiçbir şey gerçekten kaybolmaz: silme de bir işlemedir ve eski içerik geçmişte durur.
Tek dosya silme
- Dosyayı açın.
- Dosya görünümünün sağ üstündeki … menüsüne basın.
- Bu dosyayı sil'i seçin (ya da düzenleme kaleminin yanındaki 🗑️ ikonunu kullanın).
- Bir işleme mesajı yazıp Değişiklikleri Uygula'ya basın.
Klasör silme
- Klasörü açın.
- Dosya Ekle'nin yanındaki … menüsüne basın.
- Bu dizini sil'i seçin.
- İşleyin.
Klasörün içindeki her şey o tek işlemede kaldırılır.
Aynı anda birden çok dosya silme
Tarayıcı tek seferde tek yol siler. Büyük temizlik için bilgisayarınızdan çalışın (bölüm 10):
git rm -r eski-klasor
git commit -m "eski klasör kaldırıldı"
git push
Silinen dosyayı geri getirme
- Dosyanın bulunduğu klasörde Geçmiş'i ya da depo geçmişini açın.
- Silmeden önceki işlemeyi bulun.
- Dosyayı o işlemede açıp içeriği kopyalayın veya Bu noktadaki kaynağa göz at ile yeniden oluşturun.
Bir kez işlenmiş her şey geri getirilebilir. Editöre yazıp hiç işlemediğiniz bir şey getirilemez.
Dikkat edilecekler
- Dosya yerine klasörü silmek — tek dosya kastediyorsanız menü başlığının dosya dediğine bakın.
- Korumalı dallar —
mainkorumalıysa silme, değişiklik isteğiyle ilerler (bölüm 09). - Sırlar — bir parolayı dosyadan silmek onu geçmişten kaldırmaz. Parolanın kendisini değiştirin.