0

We have an main application(say main) which creates several sub applications.Currently we have decided to move one sub application (say man_ex)out of the main app folder.We are able to run the man_ex application by creating a new folder in the same branch (say newmanapp) and moving the required files into it.

However some of the required files are a part of the main application.hence we cannot move them to the man_ex folder.We can only copy them.The problem with copy is that we are not able to see the history of these files in VSTS.Although git log --follow lets me see the log in command prompt but we need to see the history in VSTS as it is.

Note: I am able to see the history by doing MV command but then the files would be deleted in the source folder.I need a copy with history kind of thing.

I have tried few solutions like below but doesn't work for me. GIT copy file preserving history

vinodsaluja
  • 455
  • 5
  • 14
  • 1
    Git can't always track files across rename or move operations. If you want to maintain a pristine history always, then your best bet is to not move/rename files. – Tim Biegeleisen Apr 22 '19 at 06:24
  • 1
    Short answer No, there is not Git copy command, for details refer this: [link](https://stackoverflow.com/questions/47401843/git-copy-file-as-opposed-to-git-mv) – vinodsaluja Apr 22 '19 at 06:54
  • you could duplicate the entire history on a orphan branch and then merge them together. – Lux Apr 22 '19 at 15:05
  • @Lux already tried that but after the merge the main app folder which has most of the applications is missing.Looks like that got overwritten by man_ex folder. – user3492389 Apr 23 '19 at 11:53
  • Then you did it wrong. It's a bit a delecate operation with filter-branch. – Lux Apr 23 '19 at 15:29
  • do you mean we need to do a different kind of merge ?.. I just ran git merge in the checkedout branch – user3492389 Apr 26 '19 at 05:08
  • Is this a duplicate of https://stackoverflow.com/questions/47401843/git-copy-file-as-opposed-to-git-mv ? – David Cary Jan 12 '22 at 05:00

0 Answers0