search

Home  >  Q&A  >  body text

Principle of restoring files with git or svn

After deleting a file locally, it can be restored immediately through the version management tool.
I think to implement this function, you need to make at least one copy of the source file and record the incremental modifications.
But I actually found that the .git and .svn directories are not particularly large. Why?

仅有的幸福仅有的幸福2823 days ago747

reply all(4)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-02 09:43:37

    Record modifications and save the latest version

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-02 09:43:37

    It’s just a place to record changes, not a backup file

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-02 09:43:37

    Git and svn are just a kind of version controller. .git or .svn only records your operation records. If you delete the file locally, it will not be deleted online, so it can still be restored.

    reply
    0
  • 为情所困

    为情所困2017-05-02 09:43:37

    Git is not an incremental backup, but actually archives every file. You think it's not particularly big because the code files are not big in the first place. Even if all the files are copied completely, it is just x2. However, in actual projects, it is impossible for every file to be modified.

    reply
    0
  • Cancelreply