1

I have a requirement , where i need to keep track of version of files user uploaded. And he can select the version he wants to taken into consideration when wanted. If he wants to set any version of file as active version , he would be able to do that. How I can i achieve this effect i.e. incorporation GIT versioning feature in my application code.

Any help would be highly thankful.

Thank you. ~Shyam

BdEngineer
  • 2,929
  • 4
  • 49
  • 85

1 Answers1

0

That means your application must manage a bare repo on your backend:

  • an upload would be added to that repo and committed
  • a request for the history of a file would generate the appropriate git log
  • access to a certain version of a file would be done through a git show

You have then various choice to encapsulate those git calls, from simple system calls to libraries like libgit2.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • This seems to be for C coded projects , is there anything similar for java based one ? thank you for your precious advice. – BdEngineer Mar 13 '14 at 17:09
  • Yes, that would be the Java library Jgit, used by Egit in Eclipse, but which can also be used standalone in your project. – VonC Mar 13 '14 at 17:14
  • @user3252097 Excellent. Please consider http://stackoverflow.com/help/accepted-answer and http://stackoverflow.com/help/why-vote (as well as http://stackoverflow.com/tour) – VonC Mar 05 '15 at 15:21