0

In my remote repo, I have multiple versions of a file that were all added and committed to the repository.

git log confirms that I have 4 versions. What i don't know how to do is to get a specific version from the remote repo down to my local directory.

Both my local directory and remote repo, for now, reside on my computer. This is because it is a new installation and we are trying to figure out how GIT works.

Jsk
  • 51
  • 1
  • 5

1 Answers1

1

If you do a git pull origin master, you should have all the commits/versions in the local repo as the master branch of the remote repo.

If you do not want all the changes, you can get a specific commit from the remote repo by doing git fetch origin SHA1-commit:refs/remotes/origin/foo-commit

If you only want a specific file, you could do -

git fetch
git checkout origin/master -- path/to/file

This would download all the changes from the remote repo, but would only apply the changes for the specific path.

Hope this helps!

rowana
  • 718
  • 2
  • 8
  • 21