Skip to content

Get a copy of specific ver of a single file from the repository #21700

Answered by seveas
chezdrz asked this question in New to GitHub
Discussion options

You must be logged in to vote

Git has various commands to do that. If you want to retrieve that copy without affecting the currently checked out files,

git show

is the command you’re looking for. For example, to retrieve the file git.c at the revision tagged v2.0.0, you would do:

git show v2.0.0:git.c

Before the colon, any revision specifier can be used (such as a sha1, a tag or a branch name). After the colon, you put the path to the file you want.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants