git 更新某个目录或文件

不多说直接贴代码

更新文件

$ git fetch

remote: Counting objects: 8, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 8 (delta 3), reused 8 (delta 3), pack-reused 0
Unpacking objects: 100% (8/8), done.
From github.com:fffy2366/checkout
   cd1768d..2408ca5  master     -> origin/master

$ git checkout -m 2408ca5 1.php 2.php

 

更新目录

$ git fetch

remote: Counting objects: 8, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 8 (delta 3), reused 8 (delta 3), pack-reused 0
Unpacking objects: 100% (8/8), done.
From github.com:fffy2366/checkout
   cd1768d..2408ca5  master     -> origin/master

$ git checkout -m 2408ca5 test1

总结

git fetch
git checkout -m 版本号 文件/文件夹
posted @ 2020-08-18 16:20  飞龙在生  阅读(9999)  评论(0编辑  收藏  举报