如何从旧本地仓库顶部的最新远程仓库状态通过扩展程序提取文件?

时间:2017-06-08 08:19:43

标签: git github

我已将我的repo重置为旧提交,现在我如何从远程仓库,而不是我的源代码中提取最新的.properties文件。

1 个答案:

答案 0 :(得分:1)

这个答案假定正在使用master分支,在本地你已经重置为某些早期的提交。您可以通过首先从回购中获取最新的master来实现您想要的效果。然后从最新的远程master分支中签出您的单个属性文件。

# update your origin/master with the latest from the remote
git fetch origin

# switch to the master branch (or another branch)
git checkout master

# checkout the properties file from the latest remote master
git checkout origin/master -- path/to/file.properties
相关问题