简体   繁体   中英

Visual Studio Git: copy files and keep history

Is there a way for a Visual Studio user to copy a bunch of files from one location to another and keep the history of both versions?

I found the answer https://stackoverflow.com/a/44036771/1520078 , which may solve the problem for single files, but I want to copy hundreds of files, preferredly not having to rename each single one.

As noted in comments, files in Git do not have history. History, in Git, is nothing but commits: the commits are the history, and each commit has a full copy of every file.

What this means is that any viewer that purports to show "file history" is lying . It may do a very good job of lying, by using commit history to find exactly what you mean by "file history", or it may do a poor job of lying, by showing you something you don't mean at all. But it definitely has to lie because there is no file history, there is only commits-as-history.

Each Git commit viewer has its own method(s) of lying to produce file history, since users like to see file history. But each viewer tends to do it a little differently. Find a viewer you like, and use that one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM