-1

I have a project that has tags to indicate versions.

How do you get a copy of an entire project by a tag named 'v1.0', without overwriting an existing project files.
I've searched a lot (including SO) but couldn't get an answer. Just please supply a good example. THX

Edit #1 (23 Nov 2013, 23:25 UTC):

To elaborate:

I have a project in a local directory on my PC. The project has been there since it was started, means I executed git init (not git clone or anything like that). From time to time I tagged some commits to indicate version (means that tag name was something like 'vX.Y' where 'X' and 'Y' is a number). Now, I want to get a copy/image of the entire project as it was existed by using a tag name, without overwriting the existing files (so that my progress won't be deleted).
I need that copy in order to make some tests with older version.

6
  • What do you mean by "copy" of a project? Do you already have the project after running git clone?
    – Leigh
    Nov 23, 2013 at 23:11
  • @Leigh: I have a project in my local directory on which I used git init and developed it for some time (adding tags once in a while). I didn't fetch the project from a server.
    – Dor
    Nov 23, 2013 at 23:13
  • Okay, so you've got the project, made your commits, and added some tags, and want to view those tags?
    – Leigh
    Nov 23, 2013 at 23:14
  • git clone <yourlocaldir> in some other directory then git checkout <thetag>
    – user180100
    Nov 23, 2013 at 23:16
  • The terminology you used in the question is causing quite a bit of confusion. Can you elaborate? Maybe offer a more context and what you'd like the outcome to be.
    – Sukima
    Nov 23, 2013 at 23:19

2 Answers 2

2

git checkout <tag> lets you roll back to that older commit to run some tests if you want, and will reset your working directory to the code that was at that tag.

Your progress that was further along the tree won't be lost (git keeps a record of it for you) but it won't be in the directory; you can get it back with git checkout master or whatever branch you were on.

You might not need to duplicate your code with git clone if you just need to check out an older version of the code.

0
0

This question should answer your question.

The missing piece of information you probably need to know to apply some of the information there is that you can use a local directory as an argument to git clone. In other words you can "download" from another directory on your computer. It's not really downloading but everything else is exactly the same.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.