I want to fetch all the previous versions of a file (let's assume Abc.xml) that I've committed in Git.
Is there any way to do so? I am sure Git has versioning system and so what I feel that my older file versions can be available. Any suggestions?
I want to fetch all the previous versions of a file (let's assume Abc.xml) that I've committed in Git.
Is there any way to do so? I am sure Git has versioning system and so what I feel that my older file versions can be available. Any suggestions?
You can see the log of your file:
git log -- myFile
Or, for all branches:
gitk --all -- myFile
Then checkout (meaning replace in your current working tree) your file with any past version
git checkout <commit> <file>
Or simply see it with git show
.
I was getting error as : object file is empty
Then check out:
Yes, you can do:
git log Abc.xml
to get hashes of commits that change this file. Then, for each hash, you can show the change:
git show c0d235cae22540ef1bcd2a35dddd919166d45666
Most IDEs have this feature integrated as well. NetBeans has a very good interface to Git.